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

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,16 +4,16 @@
*/
// 开发环境
const dev = {
// common: "http://192.168.0.100:8890",
// buyer: "http://192.168.0.100:8888",
common: "https://common-api.pickmall.cn",
buyer: "https://buyer-api.pickmall.cn",
// common: 'http://192.168.0.109:8890',
// buyer: 'http://192.168.0.109:8888',
common: "http://192.168.0.100:8890",
buyer: "http://192.168.0.100:8888",
// common: "https://common-api.pickmall.cn",
// buyer: "https://buyer-api.pickmall.cn",
// common: 'http://192.168.0.109:8890',
// buyer: 'http://192.168.0.109:8888',
};
// 生产环境
const prod = {
// common: 'http://192.168.0.109:8890',
const prod = {
// common: 'http://192.168.0.109:8890',
// buyer: 'http://192.168.0.109:8888',
common: "https://common-api.pickmall.cn",
buyer: "https://buyer-api.pickmall.cn",

View File

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

View File

@ -51,7 +51,6 @@
</div>
</div>
</div>
</template>
<script>
import { getGoodsList } from "@/api/goods.js";
@ -65,10 +64,10 @@ export default {
from: "",
payPrice: 0,
goodsList: [],
activeColor:this.$mainColor,
activeColor: this.$mainColor,
params: {
pageSize: 12,
pageNumber: 0,
pageNumber: 1,
},
};
},
@ -112,12 +111,11 @@ export default {
uni.requestSubscribeMessage({
tmplIds: templateid,
success: (res) => {
for(let key in res){
if(res[key] == "reject"){
this.checked = false;
}
}
for (let key in res) {
if (res[key] == "reject") {
this.checked = false;
}
}
},
fail: (res) => {
uni.removeStorageSync("acceptSubscribeMessage");
@ -155,7 +153,6 @@ export default {
margin: 0 auto 40rpx auto;
padding: 0 20rpx 20rpx;
width: 80%;
}
.pay-btns {
display: flex;

View File

@ -114,7 +114,7 @@
<!-- 发票信息 -->
<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">

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>
<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 === 'COMPLETE'
" @click="reBuy(order)">
再次购买
</u-button>
</u-button> -->
</view>
</view>
</view>
@ -457,10 +458,12 @@ export default {
* 重新购买
*/
reBuy(order) {
console.log(order)
return
uni.navigateTo({
url:
"/pages/product/goods?id=" +
order.groupSkuId +
order.id +
"&goodsId=" +
order.goodsId,
});

View File

@ -394,12 +394,22 @@ export default {
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: {
isGroup(val) {
if (val) {
let timer = setInterval(() => {
this.$refs.popupGoods.buyType = "PINTUAN";
clearInterval(timer);
}, 100);
@ -442,10 +452,12 @@ export default {
},
async onLoad(options) {
this.routerVal = options;
// #ifdef MP-WEIXIN
//
uni.showShareMenu({ withShareTicket: true });
uni.showShareMenu({
withShareTicket: true,
menus: ["shareAppMessage", "shareTimeline"],
});
// #endif
},
async onShow() {
@ -501,6 +513,12 @@ export default {
});
let response = await getGoods(id, goodsId);
if (!response.data.success) {
uni.navigateBack({
delta: 2,
});
return false;
}
//
if (distributionId || this.$store.state.distributionId) {

View File

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