Browse Source

增加了微信分享

feature/feature-compatible
wangkesi 7 years ago
parent
commit
a4dd7bbbf8
4 changed files with 38 additions and 8 deletions
  1. 6
      src/view/goods-classify.vue
  2. 11
      src/view/order-check.vue
  3. 11
      src/view/order-detail.vue
  4. 18
      src/view/order-list.vue

6
src/view/goods-classify.vue

@ -281,9 +281,9 @@ export default {
word-break: break-all;
i {
font-style: normal;
line-height: 1.5;
background: rgba(255, 242, 229, 1);
padding: 0.05rem 0.1rem;
line-height: 1.5;
background: rgba(255, 242, 229, 1);
padding: 0.05rem 0.1rem;
}
}
.ellipsis {

11
src/view/order-check.vue

@ -125,6 +125,7 @@ export default {
this.agree = true;
let data = res.response;
this.info = data;
this.wechat(data.merchantNo);
} else if (res.code == 666) {
this.$vux.toast.text("您还没登录,请先登录!", "middle");
setTimeout(function() {
@ -263,6 +264,16 @@ export default {
});
return promise;
},
wechat(merchantNo) {
this.wxShare({
merchantNo: merchantNo,
source: 0,
url: encodeURIComponent(location.href),
shareUrl: encodeURIComponent(
"http://" + location.host + "/v2/home"
)
});
},
go() {
let goodsVersion = this.getParam("goodsVersion") || "";
sessionStorage.setItem("goodsVersion", goodsVersion);

11
src/view/order-detail.vue

@ -147,6 +147,7 @@ export default {
.then(res => {
if (res.code === 0 && res.response.data) {
let info = res.response.data;
this.wechat(info.merchantNo);
info.create = info.createdAt
? this.getTime(info.createdAt)
: "";
@ -220,6 +221,16 @@ export default {
this.info.orderNo;
}
},
wechat(merchantNo) {
this.wxShare({
merchantNo: merchantNo,
source: 0,
url: encodeURIComponent(location.href),
shareUrl: encodeURIComponent(
"http://" + location.host + "/v2/home"
)
});
},
pay() {
this.addOrder().then(res => {
this.$vux.loading.show({

18
src/view/order-list.vue

@ -45,6 +45,9 @@ export default {
.then(res => {
if (res && res.code == 0) {
this.list = res.response.slice();
if (this.list.length > 0) {
this.wechat(this.list[0].merchantNo);
}
} else if (res.code == 666) {
this.$vux.toast.text("您还没登录,请先登录!", "middle");
setTimeout(function() {
@ -62,14 +65,19 @@ export default {
}
this.$vux.loading.hide();
});
},
wechat(merchantNo) {
this.wxShare({
merchantNo: merchantNo,
source: 0,
url: encodeURIComponent(location.href),
shareUrl: encodeURIComponent(
"http://" + location.host + "/v2/home"
)
});
}
},
mounted() {
// this.wxShare({
// merchantNo: merchantNo,
// source: 0,
// url: encodeURIComponent(location.href)
// });
this.getData();
}
};

Loading…
Cancel
Save