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

@ -16,7 +16,7 @@ const api = {
// 商品价格修改
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'
// 获取分享图
export const getStoreInfo = (param) => {
return request.post('store/getStoreInfo', param)
}
// 邀请有礼 邀请好友海报
export const InviteUserPoster = (param) => {
return request.post('user/InviteUserPoster', param)

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

@ -175,6 +175,13 @@
//
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', {
mode: 'buyNow',

@ -84,20 +84,20 @@
</view>
</view>
<view class="orderInfo">
<!--
<!-- <template v-if="userInfo.user_type == 40">
<view class="chosed" v-if="goods.spec_type == 20">
<view class="title">已选</view>
<view class="info">{{
}}</view>-->
<!-- <view class="info" v-if="goods.skuList.length>0">
<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>
<u-icon name="arrow-right" color="#7C7C7C"></u-icon>
</view>
<view class="chosed" v-else>
<view class="title">已选</view>
<view class="info">1</view>
</view>-->
<u-icon name="arrow-right" color="#7C7C7C"></u-icon>
</view>
</template> -->
<view class="chosed" v-if="goods.skuList && goods.skuList.length > 0 && goods.skuList[0].stock_num > 0">
<view class="title">送至</view>
<view class="info">
@ -207,7 +207,10 @@
</view>
</template>
<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>
</template>
@ -293,7 +296,7 @@
</view>
<view class="msp">
<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 class="msp">
<text>商品价格:</text>
@ -327,7 +330,7 @@
<text></text>
</view> -->
<view class="operaBtn">
<view class="cancel btnComm" @click="shareCancel()">
<view class="cancel btnComm" @click="shareCancel(1)">
取消
</view>
<view class="sureBtn btnComm" @click="toUnpdatePrice()">
@ -417,7 +420,7 @@
</view>
</view>
</view>
<view class="shareCancel" @click="shareCancel()">
<view class="shareCancel" @click="shareCancel(1)">
取消
</view>
</view>
@ -425,8 +428,9 @@
<view class="toTop" v-if="isTop" @click="openScrollTo()">
<image :src="$picUrl+'/static/toTop.png'"></image>
</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}" />
</view>
@ -444,6 +448,8 @@
},
data() {
return {
isTodo: true,
result: {},
max_price: "",
markup_rate: "",
showGoodsPosterPopup: false,
@ -476,12 +482,13 @@
addressInfo: {},
serveList:[],
isLogin: false,
selectShop: {},
// api
posterApiCall: GoodsApi.poster,
}
},
onLoad(options) {
const that = this;
console.log(options,"oo")
this.isPre = options.isPre?options.isPre:null
this.goodsId = options.goodsId?options.goodsId:null
@ -494,6 +501,12 @@
this.getServeList()
this.getGoodsDetail()
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() {
if(uni.getStorageSync('AccessToken')){
@ -530,19 +543,22 @@
})
return ;
}
let sku_id = ""
if(that.goods.spec_type == 20){
sku_id = that.goods.skuList[0].id
}
let params={
id: that.goods.goods_id,
goods_price: that.max_price,
line_price: that.markup_rate,
cat_id: that.goods.category.category_id
sku_id: sku_id.toString()
}
GoodsApi.editGoodsPrice(params).then(res => {
if (res.status == 200) {
that.shareCancel();
that.$toast("修改成功");
setTimeout(()=>{
that.getGoodsDetail();
},1000)
that.getGoodsDetail(1);
},500)
}
})
.catch()
@ -560,9 +576,13 @@
})
},
//
openPirce() {
openPirce(type) {
this.openDialog = true;
this.shareType= 'setPrice'
if(type == 1){
this.selectShop = {}
this.selectShop.price = this.goods.goods_price_max;
}
},
//
previewImage(i){
@ -697,6 +717,7 @@
console.log(total)
},
choseSku(skuMode) {
console.log(this.goods)
if(!uni.getStorageSync("AccessToken")) {
uni.navigateTo({
url: "/pages/login/index"
@ -723,22 +744,20 @@
});
},
//
getGoodsDetail() {
getGoodsDetail(type) {
const that = this
return new Promise((resolve, reject) => {
GoodsApi.detail(this.goodsId)
.then(result => {
let info = result.data.detail;
that.goods.skuList = [];
that.godds = {}
info.goods_images1 = []
if(info.goods_images && info.goods_images.length > 0){
info.goods_images.map(a=>{
info.goods_images1.push(a.preview_url)
})
}
// if(info.skuList && info.skuList.length > 0){
// info.skuList = info.skuList.reverse();
// }
info.content = info.content
.replace(/style=""/g,'')
.replace(/<img src=/g,'<img style="width: 100%; display:block" src=')
@ -747,8 +766,13 @@
this.$set(this.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()
})
@ -847,6 +871,7 @@
},
shareCancel() {
this.shareType = "";
this.isTodo = true;
this.openDialog = false;
},
toHaibao(index){

@ -13,7 +13,7 @@
京东电器官方福利群
</view>
<view class="qcode">
<image :src="cityInfo.wechat"></image>
<image :src="cityInfo.group_share_img"></image>
</view>
<view class="submitBtn">
立即进群>
@ -37,12 +37,12 @@
<text>品质抢团</text>
</view>
</view>
</view>
</view>
</template>
<script>
import * as newFunApi from '@/api/newFun'
export default {
data() {
return {
@ -50,7 +50,19 @@
}
},
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() {
return {
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
*/
onShareTimeline() {
const app = this
//
const params = app.$getShareUrlParams({
goodsId: app.goodsId,
})
return {
title: app.goods.goods_name,
path: `/pages/goods/detail?${params}`
title: "进社群领取更多福利",
imageUrl: this.cityInfo.group_share_img
}
}
}

Loading…
Cancel
Save