商品详情页分享朋友圈分享好友,以及一些小优化

master
lemon橪 2021-06-25 19:01:37 +08:00
parent ca1cfb7575
commit 6f162b6d15
7 changed files with 62 additions and 42 deletions

View File

@ -4,10 +4,10 @@
*/ */
// 开发环境 // 开发环境
const dev = { const dev = {
// common: "http://192.168.0.100:8890", common: "http://192.168.0.100:8890",
// buyer: "http://192.168.0.100:8888", buyer: "http://192.168.0.100:8888",
common: "https://common-api.pickmall.cn", // common: "https://common-api.pickmall.cn",
buyer: "https://buyer-api.pickmall.cn", // buyer: "https://buyer-api.pickmall.cn",
// common: 'http://192.168.0.109:8890', // common: 'http://192.168.0.109:8890',
// buyer: 'http://192.168.0.109:8888', // buyer: 'http://192.168.0.109:8888',
}; };

View File

@ -147,9 +147,9 @@
awaitPay(payment){ awaitPay(payment){
this.$u.throttle(()=>{
this.pay(payment) this.pay(payment)
}, 2000)
}, },
// //
@ -179,10 +179,10 @@
// //
if (!signXml.data.success) { if (!signXml.data.success) {
uni.showModal({ uni.showToast({
content: signXml.data.message, title: signXml.data.message,
showCancel: false, duration: 2000
}) });
return; return;
} }
@ -229,10 +229,11 @@
if(paymentMethod !== "ALIPAY"){ if(paymentMethod !== "ALIPAY"){
// //
if (!response.success) { if (!response.success) {
uni.showModal({ uni.showToast({
content: response.message, title: response.message,
showCancel: false, duration: 2000,
}) icon:"none"
});
return; return;
} }
} }

View File

@ -51,7 +51,6 @@
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
import { getGoodsList } from "@/api/goods.js"; import { getGoodsList } from "@/api/goods.js";
@ -68,7 +67,7 @@ export default {
activeColor: this.$mainColor, activeColor: this.$mainColor,
params: { params: {
pageSize: 12, pageSize: 12,
pageNumber: 0, pageNumber: 1,
}, },
}; };
}, },
@ -117,7 +116,6 @@ export default {
this.checked = false; this.checked = false;
} }
} }
}, },
fail: (res) => { fail: (res) => {
uni.removeStorageSync("acceptSubscribeMessage"); uni.removeStorageSync("acceptSubscribeMessage");
@ -155,7 +153,6 @@ export default {
margin: 0 auto 40rpx auto; margin: 0 auto 40rpx auto;
padding: 0 20rpx 20rpx; padding: 0 20rpx 20rpx;
width: 80%; width: 80%;
} }
.pay-btns { .pay-btns {
display: flex; display: flex;

View File

@ -114,7 +114,7 @@
<!-- 发票信息 --> <!-- 发票信息 -->
<invoices :res="receiptList" @callbackInvoice="callbackInvoice" v-if="invoiceFlag" /> <invoices :res="receiptList" @callbackInvoice="callbackInvoice" v-if="invoiceFlag" />
<u-select v-model="shippingFlag" :list="shippingMethod" @confirm="checkedshipMethod"></u-select> <u-select v-model="shippingFlag" :list="shippingMethod" ></u-select>
<!-- 优惠券 --> <!-- 优惠券 -->
<div class="box box4"> <div class="box box4">

View File

@ -57,12 +57,13 @@
<u-button ripple :customStyle="{'background':lightColor,'color':'#fff' }" shape="circle" class="pay-btn" size="mini" v-if="order.allowOperationVO.rog" @click="onRog(order.sn)"> <u-button ripple :customStyle="{'background':lightColor,'color':'#fff' }" shape="circle" class="pay-btn" size="mini" v-if="order.allowOperationVO.rog" @click="onRog(order.sn)">
确认收货 确认收货
</u-button> </u-button>
<u-button ripple shape="circle" class="rebuy-btn" size="mini" v-if=" <!-- TODO 后续完善 -->
<!-- <u-button ripple shape="circle" class="rebuy-btn" size="mini" v-if="
order.orderStatus === 'CANCELLED' || order.orderStatus === 'CANCELLED' ||
order.orderStatus === 'COMPLETE' order.orderStatus === 'COMPLETE'
" @click="reBuy(order)"> " @click="reBuy(order)">
再次购买 再次购买
</u-button> </u-button> -->
</view> </view>
</view> </view>
</view> </view>
@ -457,10 +458,12 @@ export default {
* 重新购买 * 重新购买
*/ */
reBuy(order) { reBuy(order) {
console.log(order)
return
uni.navigateTo({ uni.navigateTo({
url: url:
"/pages/product/goods?id=" + "/pages/product/goods?id=" +
order.groupSkuId + order.id +
"&goodsId=" + "&goodsId=" +
order.goodsId, order.goodsId,
}); });

View File

@ -394,12 +394,22 @@ export default {
routerVal: "", routerVal: "",
}; };
}, },
// #ifdef MP-WEIXNI
shareAppMessage() {
return {
title: this.goodsDetail.goodsName,
type: 0,
query:`id=${this.routerVal.id}&goodsId=${this.routerVal.goodsId}`,
path: `/pages/product/goods`,
imageUrl:this.goodsDetail.goodsGalleryList[0],
};
},
// #endif
watch: { watch: {
isGroup(val) { isGroup(val) {
if (val) { if (val) {
let timer = setInterval(() => { let timer = setInterval(() => {
this.$refs.popupGoods.buyType = "PINTUAN"; this.$refs.popupGoods.buyType = "PINTUAN";
clearInterval(timer); clearInterval(timer);
}, 100); }, 100);
@ -442,10 +452,12 @@ export default {
}, },
async onLoad(options) { async onLoad(options) {
this.routerVal = options; this.routerVal = options;
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// //
uni.showShareMenu({ withShareTicket: true }); uni.showShareMenu({
withShareTicket: true,
menus: ["shareAppMessage", "shareTimeline"],
});
// #endif // #endif
}, },
async onShow() { async onShow() {
@ -501,6 +513,12 @@ export default {
}); });
let response = await getGoods(id, goodsId); let response = await getGoods(id, goodsId);
if (!response.data.success) {
uni.navigateBack({
delta: 2,
});
return false;
}
// //
if (distributionId || this.$store.state.distributionId) { if (distributionId || this.$store.state.distributionId) {

View File

@ -96,9 +96,10 @@ export default {
this.init(); this.init();
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// //
uni.showShareMenu({ withShareTicket: true }); uni.showShareMenu({ withShareTicket: true, });
// #endif // #endif
}, },
methods: { methods: {
/** /**
* 实例化首页数据楼层 * 实例化首页数据楼层