fanfan 9 months ago
commit 53b2d039fb
  1. 2
      api/goods/index.js
  2. 5
      api/newFun.js
  3. 29
      components/goods-sku-popup/index.vue
  4. 9
      pages/goods/components/SkuPopup.vue
  5. 99
      pages/goods/detail.vue
  6. 29
      pages/news1/jinqun.vue

@ -16,7 +16,7 @@ const api = {
// 商品价格修改 // 商品价格修改
export const editGoodsPrice = (param, option) => { export const editGoodsPrice = (param, option) => {
return request.get('StoreKeeper/editGoodsPrice', param, option) return request.post('StoreKeeper/editGoodsPrice', param, option)
} }
// 商品浏览记录 // 商品浏览记录

@ -1,5 +1,10 @@
import request from '@/utils/request' import request from '@/utils/request'
// 获取分享图
export const getStoreInfo = (param) => {
return request.post('store/getStoreInfo', param)
}
// 邀请有礼 邀请好友海报 // 邀请有礼 邀请好友海报
export const InviteUserPoster = (param) => { export const InviteUserPoster = (param) => {
return request.post('user/InviteUserPoster', param) return request.post('user/InviteUserPoster', param)

@ -24,7 +24,6 @@
</view> </view>
</view> </view>
</view> </view>
<view class="specification-content"> <view class="specification-content">
<view v-show="isManyCom" class="specification-item" v-for="(item, index1) in goodsInfo[specListName]" :key="index1"> <view v-show="isManyCom" class="specification-item" v-for="(item, index1) in goodsInfo[specListName]" :key="index1">
<view class="item-title">{{ item.name }}</view> <view class="item-title">{{ item.name }}</view>
@ -39,7 +38,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="number-box-view"> <view class="number-box-view" v-if="!userInfo.user_type || userInfo.user_type != 40">
<view style="flex: 1;">数量</view> <view style="flex: 1;">数量</view>
<view style="flex: 4;text-align: right;"> <view style="flex: 4;text-align: right;">
<number-box v-model="selectNum" :min="minBuyNum || 1" :max="maxBuyNumCom" :step="stepBuyNum || 1" <number-box v-model="selectNum" :min="minBuyNum || 1" :max="maxBuyNumCom" :step="stepBuyNum || 1"
@ -68,7 +67,7 @@
color: themeColorFn('buyNowColor'), color: themeColorFn('buyNowColor'),
backgroundColor: themeColorFn('buyNowBackgroundColor') backgroundColor: themeColorFn('buyNowBackgroundColor')
}" @click="buyNow"> }" @click="buyNow">
{{ buyNowText }} {{ userInfo.user_type == 40?'修改价格':buyNowText }}
</view> </view>
</view> </view>
<view class="btn-wrapper" v-else-if="mode == 2"> <view class="btn-wrapper" v-else-if="mode == 2">
@ -84,7 +83,7 @@
color: themeColorFn('buyNowColor'), color: themeColorFn('buyNowColor'),
backgroundColor: themeColorFn('buyNowBackgroundColor') backgroundColor: themeColorFn('buyNowBackgroundColor')
}" @click="buyNow"> }" @click="buyNow">
{{ buyNowText }} {{ userInfo.user_type == 40?'修改价格':buyNowText }}
</view> </view>
</view> </view>
</view> </view>
@ -328,7 +327,8 @@
}, },
}, },
data() { data() {
return { return {
userInfo: {},
complete: false, // complete: false, //
goodsInfo: {}, // goodsInfo: {}, //
isShow: false, // true false isShow: false, // true false
@ -431,7 +431,8 @@
vk = that.vk; vk = that.vk;
if (that.valueCom) { if (that.valueCom) {
that.open(); that.open();
} }
this.userInfo = uni.getStorageSync('userInfo')
}, },
mounted() {}, mounted() {},
methods: { methods: {
@ -450,7 +451,8 @@
that.selectArr.push(''); that.selectArr.push('');
that.subIndex.push(-1); that.subIndex.push(-1);
}); });
console.log(notAutoClick,that.specListName)
console.log(that.goodsInfo)
that.checkItem(); // sku that.checkItem(); // sku
that.checkInpath(-1); // -1 that.checkInpath(-1); // -1
if (!notAutoClick) that.autoClickSku(); // sku if (!notAutoClick) that.autoClickSku(); // sku
@ -779,9 +781,6 @@
selectShop.buy_num = that.selectNum; selectShop.buy_num = that.selectNum;
that.$emit('add-cart', selectShop); that.$emit('add-cart', selectShop);
that.$emit('cart', selectShop); that.$emit('cart', selectShop);
// setTimeout(function() {
// that.init();
// }, 300);
} }
}); });
}, },
@ -789,11 +788,11 @@
buyNow() { buyNow() {
let that = this; let that = this;
that.checkSelectComplete({ that.checkSelectComplete({
success: function(selectShop) { success: function(selectShop) {
selectShop.buy_num = that.selectNum; selectShop.buy_num = that.selectNum;
console.log(selectShop) console.log(selectShop)
that.$emit('buy-now', selectShop); that.$emit('buy-now', selectShop);
that.$emit('buy', selectShop); that.$emit('buy', selectShop);
} }
}); });
}, },

@ -174,7 +174,14 @@
// //
buyNow(selectShop) { buyNow(selectShop) {
console.log("buyNow",selectShop) console.log("buyNow",selectShop)
if(uni.getStorageSync("userInfo").user_type == 40){
//
this.onChangeValue(false);
uni.$emit("onenPrice",selectShop)
return ;
console.log(selectShop)
}
// //
this.$navTo('pages/sureOrder/index', { this.$navTo('pages/sureOrder/index', {
mode: 'buyNow', mode: 'buyNow',

@ -84,20 +84,20 @@
</view> </view>
</view> </view>
<view class="orderInfo"> <view class="orderInfo">
<!-- <!-- <template v-if="userInfo.user_type == 40">
<view class="chosed" v-if="goods.spec_type == 20"> <view class="chosed" v-if="goods.spec_type == 20">
<view class="title">已选</view> <view class="title">已选</view>
<view class="info">{{ <view class="info" style="justify-content: flex-start;" v-if="goods.skuList.length>0">
<text v-for="(a,idx) in goods.skuList[0].goods_props" :key="idx" style="margin-right: 10rpx;">{{a.group.name}}{{a.value.name}}</text>1件
}}</view>--> </view>
<!-- <view class="info" v-if="goods.skuList.length>0"> <u-icon name="arrow-right" color="#7C7C7C"></u-icon>
<text v-for="(a,idx) in goods.skuList[0].goods_props" :key="idx" style="margin-right: 10rpx;">{{a.group.name}}{{a.value.name}}</text>1件 </view>
</view> --> <view class="chosed" v-else>
<!-- </view> <view class="title">已选</view>
<view class="chosed" v-else> <view class="info">1</view>
<view class="title">已选</view> <u-icon name="arrow-right" color="#7C7C7C"></u-icon>
<view class="info">1</view> </view>
</view>--> </template> -->
<view class="chosed" v-if="goods.skuList && goods.skuList.length > 0 && goods.skuList[0].stock_num > 0"> <view class="chosed" v-if="goods.skuList && goods.skuList.length > 0 && goods.skuList[0].stock_num > 0">
<view class="title">送至</view> <view class="title">送至</view>
<view class="info"> <view class="info">
@ -207,7 +207,10 @@
</view> </view>
</template> </template>
<template v-else> <template v-else>
<view class="btn-bg" style="background-color: #FF1D1D;" @click="openPirce()"> <view class="btn-bg" v-if="goods.spec_type == 20" style="background-color: #FF1D1D;" @click="choseSku(3)">
修改价格
</view>
<view class="btn-bg" v-else style="background-color: #FF1D1D;" @click="openPirce(1)">
修改价格 修改价格
</view> </view>
</template> </template>
@ -293,7 +296,7 @@
</view> </view>
<view class="msp"> <view class="msp">
<text>原价格:</text> <text>原价格:</text>
<input type="text" disabled v-model="goods.goods_price_min" class="inp" /> <input type="text" disabled v-model="selectShop.price" class="inp" />
</view> </view>
<view class="msp"> <view class="msp">
<text>商品价格:</text> <text>商品价格:</text>
@ -327,7 +330,7 @@
<text></text> <text></text>
</view> --> </view> -->
<view class="operaBtn"> <view class="operaBtn">
<view class="cancel btnComm" @click="shareCancel()"> <view class="cancel btnComm" @click="shareCancel(1)">
取消 取消
</view> </view>
<view class="sureBtn btnComm" @click="toUnpdatePrice()"> <view class="sureBtn btnComm" @click="toUnpdatePrice()">
@ -417,7 +420,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="shareCancel" @click="shareCancel()"> <view class="shareCancel" @click="shareCancel(1)">
取消 取消
</view> </view>
</view> </view>
@ -425,8 +428,9 @@
<view class="toTop" v-if="isTop" @click="openScrollTo()"> <view class="toTop" v-if="isTop" @click="openScrollTo()">
<image :src="$picUrl+'/static/toTop.png'"></image> <image :src="$picUrl+'/static/toTop.png'"></image>
</view> </view>
<SkuPopup v-model="showSkuPopup" :skuMode="skuMode" :goods="goods" @updateSku="updateSku" @addCart="onAddCart" /> <view v-if="isTodo">
<SkuPopup v-model="showSkuPopup" :skuMode="skuMode" :goods="goods" @addCart="onAddCart" />
</view>
<!-- 海报图弹层 --> <!-- 海报图弹层 -->
<goods-poster-popup v-model="showGoodsPosterPopup" :apiCall="posterApiCall" :apiParam="{goodsId}" /> <goods-poster-popup v-model="showGoodsPosterPopup" :apiCall="posterApiCall" :apiParam="{goodsId}" />
</view> </view>
@ -444,6 +448,8 @@
}, },
data() { data() {
return { return {
isTodo: true,
result: {},
max_price: "", max_price: "",
markup_rate: "", markup_rate: "",
showGoodsPosterPopup: false, showGoodsPosterPopup: false,
@ -476,12 +482,13 @@
addressInfo: {}, addressInfo: {},
serveList:[], serveList:[],
isLogin: false, isLogin: false,
selectShop: {},
// api // api
posterApiCall: GoodsApi.poster, posterApiCall: GoodsApi.poster,
} }
}, },
onLoad(options) { onLoad(options) {
const that = this;
console.log(options,"oo") console.log(options,"oo")
this.isPre = options.isPre?options.isPre:null this.isPre = options.isPre?options.isPre:null
this.goodsId = options.goodsId?options.goodsId:null this.goodsId = options.goodsId?options.goodsId:null
@ -493,7 +500,13 @@
this.getSuggestGoods() this.getSuggestGoods()
this.getServeList() this.getServeList()
this.getGoodsDetail() this.getGoodsDetail()
this.cityInfo = uni.getStorageSync("cityInfo"); this.cityInfo = uni.getStorageSync("cityInfo");
uni.$on("onenPrice",function(selectShop) {
that.openPirce();
that.isTodo = false;
that.selectShop = selectShop
that.selectShop.price = that.selectShop.price/100
})
}, },
onShow() { onShow() {
if(uni.getStorageSync('AccessToken')){ if(uni.getStorageSync('AccessToken')){
@ -530,19 +543,22 @@
}) })
return ; return ;
} }
let sku_id = ""
if(that.goods.spec_type == 20){
sku_id = that.goods.skuList[0].id
}
let params={ let params={
id: that.goods.goods_id, id: that.goods.goods_id,
goods_price: that.max_price, goods_price: that.max_price,
line_price: that.markup_rate, line_price: that.markup_rate,
cat_id: that.goods.category.category_id sku_id: sku_id.toString()
} }
GoodsApi.editGoodsPrice(params).then(res => { GoodsApi.editGoodsPrice(params).then(res => {
if (res.status == 200) { if (res.status == 200) {
that.shareCancel();
that.$toast("修改成功"); that.$toast("修改成功");
setTimeout(()=>{ setTimeout(()=>{
that.getGoodsDetail(); that.getGoodsDetail(1);
},1000) },500)
} }
}) })
.catch() .catch()
@ -560,9 +576,13 @@
}) })
}, },
// //
openPirce() { openPirce(type) {
this.openDialog = true; this.openDialog = true;
this.shareType= 'setPrice' this.shareType= 'setPrice'
if(type == 1){
this.selectShop = {}
this.selectShop.price = this.goods.goods_price_max;
}
}, },
// //
previewImage(i){ previewImage(i){
@ -697,6 +717,7 @@
console.log(total) console.log(total)
}, },
choseSku(skuMode) { choseSku(skuMode) {
console.log(this.goods)
if(!uni.getStorageSync("AccessToken")) { if(!uni.getStorageSync("AccessToken")) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/login/index" url: "/pages/login/index"
@ -723,22 +744,20 @@
}); });
}, },
// //
getGoodsDetail() { getGoodsDetail(type) {
const that = this const that = this
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
GoodsApi.detail(this.goodsId) GoodsApi.detail(this.goodsId)
.then(result => { .then(result => {
let info = result.data.detail; let info = result.data.detail;
that.goods.skuList = [];
that.godds = {}
info.goods_images1 = [] info.goods_images1 = []
if(info.goods_images && info.goods_images.length > 0){ if(info.goods_images && info.goods_images.length > 0){
info.goods_images.map(a=>{ info.goods_images.map(a=>{
info.goods_images1.push(a.preview_url) info.goods_images1.push(a.preview_url)
}) })
} }
// if(info.skuList && info.skuList.length > 0){
// info.skuList = info.skuList.reverse();
// }
info.content = info.content info.content = info.content
.replace(/style=""/g,'') .replace(/style=""/g,'')
.replace(/<img src=/g,'<img style="width: 100%; display:block" src=') .replace(/<img src=/g,'<img style="width: 100%; display:block" src=')
@ -746,9 +765,14 @@
Object.keys(info).forEach(item=>{ Object.keys(info).forEach(item=>{
this.$set(this.goods,item,info[item]) this.$set(this.goods,item,info[item])
// that.goods[item] = info[item] // that.goods[item] = info[item]
}) })
that.allPicture = info.goods_images.length;
that.allPicture = info.goods_images.length if(type == 1){
that.selectShop = {}
that.max_price = ""
that.markup_rate = ""
that.shareCancel();
}
}) })
.catch() .catch()
}) })
@ -847,6 +871,7 @@
}, },
shareCancel() { shareCancel() {
this.shareType = ""; this.shareType = "";
this.isTodo = true;
this.openDialog = false; this.openDialog = false;
}, },
toHaibao(index){ toHaibao(index){

@ -13,7 +13,7 @@
京东电器官方福利群 京东电器官方福利群
</view> </view>
<view class="qcode"> <view class="qcode">
<image :src="cityInfo.wechat"></image> <image :src="cityInfo.group_share_img"></image>
</view> </view>
<view class="submitBtn"> <view class="submitBtn">
立即进群> 立即进群>
@ -37,12 +37,12 @@
<text>品质抢团</text> <text>品质抢团</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import * as newFunApi from '@/api/newFun'
export default { export default {
data() { data() {
return { return {
@ -50,7 +50,19 @@
} }
}, },
onReady() { onReady() {
this.cityInfo = uni.getStorageSync("cityInfo") this.getList();
},
methods: {
async getList() {
let {
status,
message,
data
} = await newFunApi.getStoreInfo({});
if (status == 200) {
this.cityInfo = data
}
},
}, },
/** /**
* 分享当前页面 * 分享当前页面
@ -58,7 +70,7 @@
onShareAppMessage() { onShareAppMessage() {
return { return {
title: "进社群领取更多福利", title: "进社群领取更多福利",
imageUrl: this.cityInfo.we imageUrl: this.cityInfo.group_share_img
} }
}, },
@ -68,14 +80,9 @@
* https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html
*/ */
onShareTimeline() { onShareTimeline() {
const app = this
//
const params = app.$getShareUrlParams({
goodsId: app.goodsId,
})
return { return {
title: app.goods.goods_name, title: "进社群领取更多福利",
path: `/pages/goods/detail?${params}` imageUrl: this.cityInfo.group_share_img
} }
} }
} }

Loading…
Cancel
Save