Bladeren bron

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

lemon橪 4 jaren geleden
bovenliggende
commit
6f162b6d15

+ 8 - 8
config/api.js

@@ -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",

+ 17 - 16
pages/cart/payment/payOrder.vue

@@ -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);

+ 7 - 10
pages/cart/payment/success.vue

@@ -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;

+ 1 - 1
pages/order/fillorder.vue

@@ -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">

+ 6 - 3
pages/order/myOrder.vue

@@ -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,
       });

+ 21 - 3
pages/product/goods.vue

@@ -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) {

+ 2 - 1
pages/tabbar/home/views.vue

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