Forráskód Böngészése

修复支付字段覆盖问题
修复微信小程序无法显示loading问题
修复拼团保存bug
修复支付跳转bug
优化拼团海报生成
修改视频组件
修复发货bug
修复safari浏览器无法window.open问题

yongzonghuang 3 éve
szülő
commit
74ee9bc271

+ 45 - 1
components/canvasShow/basics/video.vue

@@ -4,7 +4,13 @@
       <h3>{{componentContent.title}}</h3>
       <div v-html="componentContent.mainBody"></div>
     </div>
-    <div class="videoRightBox">
+    <div class="videoRightBox" v-if="componentContent.coverImg && isPlay">
+      <video class="myVideo" id="myVideo" :src="componentContent.videoUrl" enable-danmu danmu-btn controls></video>
+    </div>
+    <div class="videoCoverBox" v-if="componentContent.coverImg && !isPlay" @click="handlePlayVideo">
+      <image :src="componentContent.coverImg" ></image>
+    </div>
+    <div class="videoRightBox" v-if="!componentContent.coverImg">
       <video class="myVideo" id="myVideo" :src="componentContent.videoUrl" enable-danmu danmu-btn controls></video>
     </div>
     <div class="clear"></div>
@@ -23,8 +29,24 @@ export default {
       type: Object
     }
   },
+  created(){
+    console.log('componentContent',this.componentContent)
+  },
+  mounted() {
+    this.videoContext = uni.createVideoContext('myVideo',this)
+  },
   data () {
     return {
+      isPlay:false,
+      videoContext:null
+    }
+  },
+  methods:{
+    handlePlayVideo(){
+      this.isPlay = true
+      setTimeout(()=>{
+        this.videoContext.play()
+      },500)
     }
   }
 }
@@ -73,4 +95,26 @@ export default {
      }
    }
  }
+ .videoCoverBox{
+   aspect-ratio: 16/9;
+   position: relative;
+   &:before{
+     content: '';
+     width: 0rpx;
+     height: 0rpx;
+     border-left:80rpx solid #fff;
+     border-right:50rpx solid transparent;
+     border-top:50rpx solid transparent;
+     border-bottom:50rpx solid transparent;
+    position: absolute;
+     top: 50%;
+     left: 50%;
+     transform: translate(-30%,-50%);
+     z-index: 99;
+   }
+   image{
+     width: 100%;
+     height: 100%;
+   }
+ }
 </style>

+ 1 - 1
config/requestApi.js

@@ -1,4 +1,4 @@
-import { hideLoading, showLoading } from "../components/GlobalLoading";
+import { hideLoading, showLoading } from "../utils/plugIn/globalLoading.js";
 
 /**
  * @FileDescription:

+ 1 - 1
pages/tabbar/cart/cartUtils.js

@@ -1,6 +1,6 @@
 const NET = require('../../../utils/request')
 const API = require('../../../config/api')
-import {showLoading,hideLoading} from "@/components/GlobalLoading";
+import {showLoading,hideLoading} from "@/utils/plugIn/globalLoading.js";
 
 /**
  * 根据选中的购物车数据获取价格和过滤后的用于结算购物车的post数据

+ 6 - 3
pages/tabbar/cart/index.vue

@@ -223,7 +223,7 @@
       </view>
 
       <!-- 热门推荐 -->
-      <HotTemplate v-if="!loading" />
+      <HotTemplate class="u-skeleton-fillet"/>
 
       <view style="width: 100%;height: 120rpx;background-color:#fff;"></view>
 
@@ -304,6 +304,8 @@ export default {
             index: 2
           })
         }
+        // sku为空的山沟
+        const emptySkuShopArray = []
         this.dataList.forEach((shopObj, shopIndex) => {
           shopObj['currentIds'] = []
           shopObj['priceNumber'] = 0
@@ -315,6 +317,7 @@ export default {
             // shelveState是否上架
             if (shopObj.skus[i].shelveState === 0) {
               // 删掉下架商品
+              // todo 失效商品
               shopObj.skus.splice(i, 1)
               continue
             }
@@ -323,8 +326,6 @@ export default {
               shopObj.priceNumber += shopObj.skus[i].number
             }
           }
-          console.log(shopObj.skus.length)
-          this.isEmpty = shopObj.skus.length !== 0? false :true
           for (let i = 0; i < shopObj.skus.length; i++) {
             if (shopObj.skus[i].activityType === 6) {
               shopObj.ids = shopObj.skus[i].priceId
@@ -336,7 +337,9 @@ export default {
             shopObj.rules = res.data ? res.data[0].rules : {}
             this.handleSetGroupGood(shopIndex)
           })
+          shopObj.skus.length === 0?emptySkuShopArray.push(shopObj):undefined
         })
+        this.isEmpty = emptySkuShopArray.length >=this.dataList.length
         this.handleRenderCart()
         // 数据回来就直接关闭骨架屏
         this.loading = false

+ 1 - 1
pages/tabbar/index/index.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="hom-page" :style="{'padding-top': height + 'px'}">
+<!--    <gg></gg>-->
     <global-loading />
     <u-sticky offset-top="0" h5-nav-height="0" bg-color="#fff">
       <view class="head">
@@ -110,7 +111,6 @@ import CategoryList from "@/components/basics/categoryList.vue"
 import CategoryShow from "@/components/basics/categoryShow.vue"
 import comHeader from '@/components/canvasShow/basics/header/app'
 import canvasPage from '@/components/canvasShow/canvasShowPage.vue'
-
 export default {
   components: {
     AdWindow,

+ 1 - 1
pages/tabbar/user/index.vue

@@ -233,7 +233,7 @@ export default {
       let url = null
       // #ifdef H5
       console.log('h5 test')
-      window.open(API.SettledMerchantPrefix + `/#/?username=${ username }&user=${ token }`)
+      window.location.href = API.SettledMerchantPrefix + `/#/?username=${ username }&user=${ token }`
       // #endif
       // #ifdef APP-PLUS
       plus.runtime.openURL(API.SettledMerchantPrefix + `/#/?username=${ username }&user=${ token }`, function (e) {

+ 460 - 365
pages_category_page1/goodsModule/invitePoster.vue

@@ -1,391 +1,486 @@
 <template>
-	<view class="invitePoster-box">
-    <global-loading />
+  <view class="invitePoster-box">
+    <gloable-loading />
 
     <view class="poster-box flex-items-plus flex-column">
-			<image class="header-img mar-top-10" :src="data.headImage"></image>
-			<label class="mar-top-30">发现一件好物,快来和我一起拼</label>
-			<image class="poster-img mar-top-50" :src="data.image"></image>
-			<view class="flex-row-plus flex-sp-between mar-top-40">
-				<view class="flex-column-plus">
-					<label class="title-lab fs28">{{data.productName}}</label>
-					<view class="spellNum flex-items-plus font-color-C5AA7B mar-top-30 fs24">{{data.person}}人团</view>
-					<view class="flex-row-plus mar-top-20 flex-items">
-						<label class="font-color-C5AA7B fs24">¥</label>
-						<label class="font-color-C5AA7B fs36 mar-left-5">{{data.price}}</label>
-						<label class="font-color-999 fs26 mar-left-20">原价:¥{{data.originalPrice}}</label>
-					</view>
-				</view>
-				<view class="flex-column-plus flex-items-plus">
-					<image style="width: 180upx;height: 180upx;" :src="qrcode"></image>
-					<label class="font-color-666">扫描二维码</label>
-				</view>
-			</view>
-			<!-- #ifndef H5 -->
-			<view @click="savePoster(1)" class="saveposter-but flex-items-plus mar-top-50">保存海报</view>
-			<!-- #endif -->
-			<!-- #ifdef H5 -->
-			<view @click="savePoster(2)" class="saveposter-but flex-items-plus mar-top-50">预览海报</view>
-			<!-- #endif -->
-		</view>
-		<view class="bor-reu-8 pad-bot-30 canvas-box">
-			<canvas style="width: 720rpx; height: 1000rpx;" canvas-id="posterCanvas" id="posterCanvas"></canvas>
-		</view>
-	</view>
+      <image
+          class="header-img mar-top-10"
+          :src="data.headImage"
+      ></image>
+      <label class="mar-top-30">发现一件好物,快来和我一起拼</label>
+      <image
+          class="poster-img mar-top-50"
+          :src="data.image"
+      ></image>
+      <view class="flex-row-plus flex-sp-between mar-top-40">
+        <view class="flex-column-plus">
+          <label class="title-lab fs28">{{ data.productName }}</label>
+          <view class="spellNum flex-items-plus font-color-C5AA7B mar-top-30 fs24">{{ data.person }}人团</view>
+          <view class="flex-row-plus mar-top-20 flex-items">
+            <label class="font-color-C5AA7B fs24">¥</label>
+            <label class="font-color-C5AA7B fs36 mar-left-5">{{ data.price }}</label>
+            <label class="font-color-999 fs26 mar-left-20">原价:¥{{ data.originalPrice }}</label>
+          </view>
+        </view>
+        <view class="flex-column-plus flex-items-plus">
+          <image
+              style="width: 180upx;height: 180upx;"
+              :src="qrcode"
+          ></image>
+          <label class="font-color-666">扫描二维码</label>
+        </view>
+      </view>
+      <!-- #ifndef H5 -->
+      <view
+          @click="savePoster(1)"
+          class="saveposter-but flex-items-plus mar-top-50"
+      >保存海报
+      </view>
+      <!-- #endif -->
+      <!-- #ifdef H5 -->
+      <view
+          @click="savePoster(2)"
+          class="saveposter-but flex-items-plus mar-top-50"
+      >预览海报
+      </view>
+      <!-- #endif -->
+    </view>
+    <view class="bor-reu-8 pad-bot-30 canvas-box">
+      <canvas
+          style="width: 375px; height: 560px;"
+          canvas-id="posterCanvas"
+          id="posterCanvas"
+      ></canvas>
+    </view>
+  </view>
 </template>
 
 <script>
-	const NET = require('../../utils/request')
-	const API = require('../../config/api')
-	import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue'
-	import { pathToBase64, base64ToPath } from 'image-tools'
-	export default {
-		data() {
-			return {
-				data:{},
-				canvasWidth:0,
-				codeImg:'',
-				codeImg2:'',
-				headImage:'',
-				image:'',
-				qrcode:'',
-				qrcodeimg:'',
-				loadingQrcode: true
-			};
-		},
-		onLoad(options) {
-			this.data =JSON.parse(options.data)
-			this.getShare()
-		},
-		methods:{
-			savePoster(type){
-				if (this.loadingQrcode) {
-					uni.showToast({
-						icon:"none",
-						title:"请稍等,正在生成二维码..."
-					})
-					return
-				}
-				if(type == 1){
-					// uni.showLoading({
-          //   mask: true,
-					// 	title:"生成图片中..."
-					// })
-          this.$showLoading()
-					let that = this
-					setTimeout(()=>{
-            // #ifdef H5 || MP-WEIXIN || APP-PLUS
-						uni.canvasToTempFilePath({ //把画布转化成临时文件进行保存
-							fileType: 'png', // 保存成的文件类型
-							quality: 0, // 图片质量
-							canvasId: 'posterCanvas', // 画布ID
-							success:(res)=> {
-                this.$hideLoading()
-							  console.log(res.tempFilePath, 'test0000')
-                that.saveDownload(res.tempFilePath)
-							},
-							fail:()=> {
-								uni.showToast({
-									title: '保存失败,稍后再试',
-									duration: 2000,
-									icon: 'none'
-								})
-                this.$hideLoading()
-								// uni.hideLoading();
-							}
-						})
-            // #endif
-            // #ifdef MP-ALIPAY
-            const CanvasContext = my.createCanvasContext('posterCanvas');
-            CanvasContext.toTempFilePath({
-              success(res) {
-                console.log(2222)
-                console.log(res.apFilePath)
-                my.saveImage({
-                  url: res.apFilePath,
-                  success: res => {
-                    console.log('saveImage', res)
+import GloableLoading from "../../components/diyLoading";
+import { base64ToPath } from 'image-tools'
+
+const NET = require('../../utils/request')
+const API = require('../../config/api')
+export default {
+  components: {GloableLoading},
+  data() {
+    return {
+      data: {},
+      canvasWidth: 0,
+      codeImg: '',
+      codeImg2: '',
+      headImage: '',
+      image: '',
+      qrcode: '',
+      qrcodeimg: '',
+      loadingQrcode: true
+    };
+  },
+  onLoad(options) {
+    this.data = JSON.parse(options.data)
+    this.getShare()
+  },
+  methods: {
+    savePoster(type) {
+      if (this.loadingQrcode) {
+        uni.showToast({
+          icon: "none",
+          title: "请稍等,正在生成二维码..."
+        })
+        return
+      }
+      this.$showLoading()
+      if (type == 1) {
+        // uni.showLoading({
+        //   mask: true,
+        // 	title:"生成图片中..."
+        // })
+        let that = this
+        setTimeout(() => {
+          // #ifdef H5 || MP-WEIXIN || APP-PLUS
+          uni.canvasToTempFilePath({ //把画布转化成临时文件进行保存
+            fileType: 'png', // 保存成的文件类型
+            quality: 0, // 图片质量
+            canvasId: 'posterCanvas', // 画布ID
+            success: (res) => {
+              this.$hideLoading()
+              console.log(res.tempFilePath, 'test0000')
+              that.saveDownload(res.tempFilePath)
+            },
+            fail: () => {
+              uni.showToast({
+                title: '保存失败,稍后再试',
+                duration: 2000,
+                icon: 'none'
+              })
+              this.$hideLoading()
+              // uni.hideLoading();
+            }
+          })
+          // #endif
+          // #ifdef MP-ALIPAY
+          const CanvasContext = my.createCanvasContext('posterCanvas');
+          console.log('kahu', CanvasContext)
+          CanvasContext.toTempFilePath({
+            success: (res) => {
+              console.log(2222)
+              console.log(res.apFilePath)
+              my.saveImage({
+                url: res.apFilePath,
+                success: res => {
+                  console.log('saveImage', res)
+                  // uni.hideLoading();
+                  this.$hideLoading()
+                  uni.showToast({
+                    title: '图片保存成功~',
+                    duration: 2000
+                  })
+                },
+                fail: err => {
+                  this.$hideLoading()
+                  console.error('saveImage err', err)
+                },
+              })
+            },
+            fail: () => {
+              this.$hideLoading()
+              uni.showToast({
+                title: '保存失败,稍后再试',
+                duration: 2000,
+                icon: 'none'
+              })
+              // uni.hideLoading();
+            }
+          })
+          // #endif
+        }, 5000)
+      } else if (type == 2) {
+        // uni.showLoading({
+        //   mask: true,
+        // 	title:"图片生成中..."
+        // })
+        let that = this
+        setTimeout(() => {
+          uni.canvasToTempFilePath({ //把画布转化成临时文件进行保存
+            fileType: 'png', // 保存成的文件类型
+            quality: 0, // 图片质量
+            canvasId: 'posterCanvas', // 画布ID
+            success: (res) => {
+              uni.downloadFile({
+                url: res.tempFilePath,//网络路径,下载下来
+                success: (res1) => {
+                  this.$hideLoading()
+                  console.log(res1)
+                  if (res1.statusCode === 200) {
                     // uni.hideLoading();
-                    this.$hideLoading()
-                    uni.showToast({
-                      title: '图片保存成功~',
-                      duration: 2000
+                    uni.showModal({
+                      title: '提示',
+                      content: '长按即可保存图片',
+                      confirmText: "确定",
+                      cancelText: '取消',
+                      success: (res) => {
+                        if (res.confirm) {
+                          uni.previewImage({
+                            current: res1.tempFilePath, // 当前显示图片的http链接
+                            urls: [res1.tempFilePath] // 需要预览的图片http链接列表
+                          })
+                        }
+                      }
                     })
-                  },
-                  fail: err => {
-                    this.$hideLoading()
-                    console.error('saveImage err', err)
-                  },
+                  }
+                }
+              })
+            },
+            fail: (err) => {
+              this.$hideLoading()
+              uni.showToast({
+                title: '保存失败,稍后再试',
+                duration: 2000,
+                icon: 'none'
+              })
+            }
+          })
+        }, 5000)
+      }
+    },
+    saveDownload(file) {
+      const that = this
+      // uni.showLoading({
+      // mask: true,
+      // 			title:"图片保存中..."
+      // 		})
+      this.$showLoading()
+      console.log(file, 'test1')
+      uni.getImageInfo({
+        src: file,
+        success: (res1) => {
+          console.log(res1, 'test2')
+          // 2-保存图片至相册
+          console.log(2222)
+          uni.saveImageToPhotosAlbum({ // 存成图片至手机
+            filePath: res1.path, //画布保存的图片临时文件
+            success: (res2) => {
+              console.log(3333)
+              this.$hideLoading()
+              // uni.hideLoading();
+              uni.showToast({
+                title: '图片保存成功~',
+                duration: 2000
+              })
+            },
+            fail: (res3) => {
+              this.$hideLoading()
+              if (res3.errMsg === 'saveImageToPhotosAlbum:fail auth deny') {
+                // that.$store.dispatch('SetPhoneShow', 1)
+                uni.showToast({
+                  title: '保存失败,请检查是否授权小程序保存图片!',
+                  duration: 3000,
+                  icon: 'none'
                 })
-              },
-              fail:()=> {
-                this.$hideLoading()
+              } else {
                 uni.showToast({
                   title: '保存失败,稍后再试',
                   duration: 2000,
                   icon: 'none'
                 })
-                // uni.hideLoading();
               }
-            })
-            // #endif
-					},5000)
-				}else if(type == 2){
-					// uni.showLoading({
-          //   mask: true,
-					// 	title:"图片生成中..."
-					// })
-          this.$showLoading()
-					let that = this
-					setTimeout(()=>{
-						uni.canvasToTempFilePath({ //把画布转化成临时文件进行保存
-							fileType: 'png', // 保存成的文件类型
-							quality: 0, // 图片质量
-							canvasId: 'posterCanvas', // 画布ID
-							success:(res)=> {
-								uni.downloadFile({
-									url: res.tempFilePath,//网络路径,下载下来
-									success: (res1) => {
-                    this.$hideLoading()
-                    console.log(res1)
-										if (res1.statusCode === 200) {
-											// uni.hideLoading();
-											uni.showModal({
-											   title: '提示',
-											   content: '长按即可保存图片',
-											   confirmText: "确定",
-											   cancelText: '取消',
-											   success: (res) => {
-													if (res.confirm) {
-														uni.previewImage({
-															current: res1.tempFilePath, // 当前显示图片的http链接
-															urls: [res1.tempFilePath] // 需要预览的图片http链接列表
-														})
-													}
-												}
-											})
-										}
-									}
-								})
-							},
-							fail:(err)=> {
-                this.$hideLoading()
-								uni.showToast({
-									title: '保存失败,稍后再试',
-									duration: 2000,
-									icon: 'none'
-								})
-							}
-						})
-					},5000)
-				}
-			},
-      saveDownload (file) {
-				const that = this
-			  // uni.showLoading({
-			  // mask: true,
-			  // 			title:"图片保存中..."
-			  // 		})
-        this.$showLoading()
-	        console.log(file,'test1')
-	        uni.getImageInfo({
-	          src: file,
-	          success: (res1) => {
-	            console.log(res1, 'test2')
-	              // 2-保存图片至相册
-	              console.log(2222)
-	              uni.saveImageToPhotosAlbum({ // 存成图片至手机
-	                filePath: res1.path, //画布保存的图片临时文件
-	                success(res2) {
-	                  console.log(3333)
-                    this.$hideLoading()
-	                  // uni.hideLoading();
-	                  uni.showToast({
-	                    title: '图片保存成功~',
-	                    duration: 2000
-	                  })
-	                },
-	                fail(res3) {
-                    this.$hideLoading()
-	                  if (res3.errMsg === 'saveImageToPhotosAlbum:fail auth deny') {
-	                    // that.$store.dispatch('SetPhoneShow', 1)
-	                    uni.showToast({
-	                      title: '保存失败,请检查是否授权小程序保存图片!',
-	                      duration: 3000,
-	                      icon: 'none'
-	                    })
-	                  } else {
-	                    uni.showToast({
-	                      title: '保存失败,稍后再试',
-	                      duration: 2000,
-	                      icon: 'none'
-	                    })
-	                  }
-	                  // uni.hideLoading();
-	                }
-	              })
-	          }
-	        })
-      },
-			getShare(){
-				NET.request(API.getShare,
-				{
-					collageId:this.data.collageId,
-					orderId:this.data.orderId,
-					productId:this.data.productId,
-					skuId:this.data.skuId,
-					type:0
-				},
-				"GET").then(res => {
-					// #ifndef MP-WEIXIN
-					this.qrcode = res.data.qrcode
-					// #endif
-					// #ifdef MP-WEIXIN
-					this.qrcode = res.data.xcxQrcode
-					// #endif
-					console.log(this.qrcode, 'this.qrcode')
-					this.getCanvas()
-					this.loadingQrcode = false
-				}).catch(res => {
-				})
-			},
-			getCanvas(){
-				let that = this
-				uni.getImageInfo({
-					src: that.data.headImage,
-					success: function (image) {
-						that.headImage = image.path
-						uni.getImageInfo({
-							src: that.data.image,
-							success: function (image2) {
-								that.image = image2.path
-								uni.getImageInfo({
-									src: that.qrcode,
-									success: function (image3) {
-										that.qrcodeimg = image3.path
-										setTimeout(() => {
-											var ctx = uni.createCanvasContext('posterCanvas')
-											ctx.setFillStyle('#FFFFFF')
-											ctx.fillRect(15, 0, 820, 1000)
-											// ctx.drawImage(that.data.headImage, 0, 0, 150, 100)
-											that.drawRound(ctx,25,160,28,that.headImage)
-											ctx.setFontSize(14)
-											ctx.setFillStyle('#333333')
-											ctx.fillText('发现一件好物,快来和我一起拼', 89, 120)
-											ctx.drawImage(that.image, 25, 150, 310, 200)
-											ctx.setFontSize(14)
-											ctx.setFillStyle('#333333')
-											ctx.fillText(that.data.productName, 40, 390)
-											ctx.setFontSize(14)
-											ctx.setFillStyle('#C5AA7B')
-											ctx.fillText(that.data.person+'人团', 40, 430)
-											ctx.setFontSize(24)
-											ctx.setFillStyle('#C5AA7B')
-											ctx.fillText('¥'+that.data.price, 40, 470)
-											ctx.setFontSize(14)
-											ctx.setFillStyle('#999999')
-											ctx.fillText('原价:¥'+that.data.originalPrice, 120, 468)
-											ctx.drawImage(that.qrcodeimg, 245, 370,80, 80)
-											ctx.setFontSize(14)
-											ctx.setStrokeStyle('#666666')
-											ctx.fillText('扫描二维码', 250, 468)
-											ctx.draw()
-										}, 1500)
-									}
-								});
-							}
-						});
-					}
-				});
-			},
-			exportImg(){
-				uni.canvasToTempFilePath({
-					fileType: "jpg",
-					canvasId: 'couponQrcode',
-					success: function(res) {
-						let that = this
-						// 在H5平台下,tempFilePath 为 base64
-						// #ifndef H5
-						that.codeImg = res.tempFilePath
-						// #endif
-						// #ifdef H5
-						base64ToPath(res.tempFilePath).then(path => {
-							that.codeImg = path
-						}).catch(error => {
-							console.error(error)
-						});
-						// #endif
-					}
-				})
-			},
-			drawRound (ctx,r,x,y,img) {
-			    ctx.save() // 保存之前的
-			    var r = r // 半径*屏幕分辨率比例
-			    var d = 2*r // 直径
-			    var cx = x + r // 圆弧坐标x
-			    var cy = y + r // 圆弧坐标 y
-			    ctx.arc(cx, cy, r ,0, 2*Math.PI)
-			    ctx.clip() // 裁剪
-			    ctx.drawImage(img, x, y, d, d) // 画头像
-			    ctx.restore() // 返回上一状态
-			},
-		}
-	}
+              // uni.hideLoading();
+            }
+          })
+        }
+      })
+    },
+    getShare() {
+      NET.request(API.getShare,
+          {
+            collageId: this.data.collageId,
+            orderId: this.data.orderId,
+            productId: this.data.productId,
+            skuId: this.data.skuId,
+            type: 0
+          },
+          "GET").then(res => {
+        // #ifndef MP-WEIXIN
+        this.qrcode = res.data.qrcode
+        // #endif
+        // #ifdef MP-WEIXIN
+        this.qrcode = res.data.xcxQrcode
+        // #endif
+        console.log(this.qrcode, 'this.qrcode')
+        this.getCanvas()
+        this.loadingQrcode = false
+      }).catch(res => {
+      })
+    },
+    getCanvas() {
+      let that = this
+      // #ifndef MP-WEIXIN
+      uni.getImageInfo({
+        src: that.data.headImage,
+        success: function (image) {
+          that.headImage = image.path
+          uni.getImageInfo({
+            src: that.data.image,
+            success: function (image2) {
+              that.image = image2.path
+              uni.getImageInfo({
+                src: that.qrcode,
+                success: function (image3) {
+                  that.qrcodeimg = image3.path
+                  setTimeout(() => {
+                    var ctx = uni.createCanvasContext('posterCanvas')
+                    ctx.setFillStyle('#FFFFFF')
+                    ctx.fillRect(0, 0, 375, 560)
+                    // ctx.drawImage(that.data.headImage, 0, 0, 150, 100)
+                    that.drawRound(ctx, 25, 160, 28, that.headImage)
+                    ctx.setFontSize(14)
+                    ctx.setFillStyle('#333333')
+                    ctx.fillText('发现一件好物,快来和我一起拼', 89, 120)
+                    ctx.drawImage(that.image, 25, 150, 310, 200)
+                    ctx.setFontSize(14)
+                    ctx.setFillStyle('#333333')
+                    ctx.fillText(that.data.productName, 40, 390)
+                    ctx.setFontSize(14)
+                    ctx.setFillStyle('#C5AA7B')
+                    ctx.fillText(that.data.person + '人团', 40, 430)
+                    ctx.setFontSize(24)
+                    ctx.setFillStyle('#C5AA7B')
+                    ctx.fillText('¥' + that.data.price, 40, 470)
+                    ctx.setFontSize(14)
+                    ctx.setFillStyle('#999999')
+                    ctx.fillText('原价:¥' + that.data.originalPrice, 120, 468)
+                    ctx.drawImage(that.qrcodeimg, 245, 370, 80, 80)
+                    ctx.setFontSize(14)
+                    ctx.setStrokeStyle('#666666')
+                    ctx.fillText('扫描二维码', 250, 468)
+                    ctx.draw()
+                  }, 1500)
+                }
+              });
+            }
+          });
+        }
+      });
+      // #endif
+      // #ifdef MP-WEIXIN
+
+      uni.getImageInfo({
+        src: that.data.image,
+        success: function (image2) {
+          that.image = image2.path
+          uni.getImageInfo({
+            src: that.qrcode,
+            success: function (image3) {
+              that.qrcodeimg = image3.path
+              setTimeout(() => {
+                var ctx = uni.createCanvasContext('posterCanvas')
+                ctx.setFillStyle('#FFFFFF')
+                ctx.fillRect(0, 0, 375, 560)
+                // ctx.drawImage(that.data.headImage, 0, 0, 150, 100)
+                // that.drawRound(ctx, 25, 160, 28, that.headImage)
+                ctx.setFontSize(14)
+                ctx.setFillStyle('#333333')
+                ctx.fillText('发现一件好物,快来和我一起拼', 89, 120)
+                ctx.drawImage(that.image, 25, 150, 310, 200)
+                ctx.setFontSize(14)
+                ctx.setFillStyle('#333333')
+                let newStr = '',startPartIndex = 0
+                for (let i = 0; i < that.data.productName.length; i++) {
+                  if(i%14=== 0){
+                    newStr += (that.data.productName.slice(startPartIndex,i) + '\n')
+                    startPartIndex = i
+                  }
+                  if(i === that.data.productName.length-1) newStr += that.data.productName.slice(startPartIndex)
+                }
+                const productNameArr = newStr.split('\n').filter(item=>item);
+                productNameArr.forEach((productNameItem,productNameIndex)=>{
+                  let y = 390 + (productNameIndex * 22 )
+                  ctx.fillText(productNameItem, 40, y)
+                })
+                ctx.setFontSize(14)
+                ctx.setFillStyle('#C5AA7B')
+                ctx.fillText(that.data.person + '人团', 40, 430 + ((productNameArr.length - 1 )* 22))
+                ctx.setFontSize(24)
+                ctx.setFillStyle('#C5AA7B')
+                ctx.fillText('¥' + that.data.price, 40, 470 + ((productNameArr.length-1) * 22))
+                ctx.setFontSize(14)
+                ctx.setFillStyle('#999999')
+                ctx.fillText('原价:¥' + that.data.originalPrice, 120, 468+((productNameArr.length-1) * 22))
+                ctx.drawImage(that.qrcodeimg, 245, 370+ (productNameArr.length-1) * 22, 80, 80)
+                ctx.setFontSize(14)
+                ctx.setStrokeStyle('#666666')
+                ctx.fillText('扫描二维码', 250, 468 + (productNameArr.length-1) * 22)
+                ctx.draw()
+              }, 1500)
+            }
+          });
+        }
+      });
+      // #endif
+
+    },
+    exportImg() {
+      uni.canvasToTempFilePath({
+        fileType: "jpg",
+        canvasId: 'couponQrcode',
+        success: function (res) {
+          let that = this
+          // 在H5平台下,tempFilePath 为 base64
+          // #ifndef H5
+          that.codeImg = res.tempFilePath
+          // #endif
+          // #ifdef H5
+          base64ToPath(res.tempFilePath).then(path => {
+            that.codeImg = path
+          }).catch(error => {
+            console.error(error)
+          });
+          // #endif
+        }
+      })
+    },
+    drawRound(ctx, r, x, y, img) {
+      ctx.save() // 保存之前的
+      var r = r // 半径*屏幕分辨率比例
+      var d = 2 * r // 直径
+      var cx = x + r // 圆弧坐标x
+      var cy = y + r // 圆弧坐标 y
+      ctx.arc(cx, cy, r, 0, 2 * Math.PI)
+      ctx.clip() // 裁剪
+      ctx.drawImage(img, x, y, d, d) // 画头像
+      ctx.restore() // 返回上一状态
+    },
+  }
+}
 </script>
 
 <style lang="scss">
 .qrcode {
-	padding: 0upx 0 20upx 0;
-	display: flex;
-	align-items: center;
-	justify-content: center;
+  padding: 0upx 0 20upx 0;
+  display: flex;
+  align-items: center;
+  justify-content: center;
 }
+
 .title {
-	text-align: center;
+  text-align: center;
+}
+
+.canvas-box {
+  position: absolute;
+  top: -88888rpx;
 }
-.canvas-box{
-	position: absolute;
-	top: -88888rpx;
+
+page {
+  background-color: #F7F7F7;
 }
-page{background-color: #F7F7F7;}
-.invitePoster-box{
-	.bor-reu-8{border-radius: 8rpx;}
 
-	.poster-box{
-		background-color: #FFFFFF;
-		margin: 30rpx 30rpx;
-		width: 690rpx;
-		padding: 40rpx 34rpx;
-		border-radius: 8rpx;
-		.header-img{
-			width: 100rpx;
-			height: 100rpx;
-			border-radius: 50%;
-		}
-		.poster-img{
-			width: 100%;
-			height: 414rpx;
-		}
-		.title-lab{
-			width: 400rpx;
-		}
-		.spellNum{
-			background-color: #FFEDDF;
-			border-radius: 22rpx;
-			width: 144rpx;
-			height: 44rpx;
-		}
-		.code-img{
-			width: 142rpx;
-			height: 142rpx;
-		}
-		.saveposter-but{
-			border-radius: 5rpx;
-			background-color: #C5AA7B;
-			color: #FFFFFF;
-			width: 420rpx;
-			height: 66rpx;
-		}
-	}
+.invitePoster-box {
+  .bor-reu-8 {
+    border-radius: 8rpx;
+  }
+
+  .poster-box {
+    background-color: #FFFFFF;
+    margin: 30rpx 30rpx;
+    width: 690rpx;
+    padding: 40rpx 34rpx;
+    border-radius: 8rpx;
+
+    .header-img {
+      width: 100rpx;
+      height: 100rpx;
+      border-radius: 50%;
+    }
+
+    .poster-img {
+      width: 100%;
+      height: 414rpx;
+    }
+
+    .title-lab {
+      width: 400rpx;
+    }
+
+    .spellNum {
+      background-color: #FFEDDF;
+      border-radius: 22rpx;
+      width: 144rpx;
+      height: 44rpx;
+    }
+
+    .code-img {
+      width: 142rpx;
+      height: 142rpx;
+    }
+
+    .saveposter-but {
+      border-radius: 5rpx;
+      background-color: #C5AA7B;
+      color: #FFFFFF;
+      width: 420rpx;
+      height: 66rpx;
+    }
+  }
 }
 </style>

+ 0 - 1
pages_category_page1/goodsModule/inviteSpell.vue

@@ -40,7 +40,6 @@
           </view>
         </view>
 		  <view v-if="remainPerson !== 0">
-        {{ type }}
 			  <view class="mar-top-50 font-color-333">还差<label class="font-color-C5AA7B">{{remainPerson}}</label>人成团,距结束还剩{{hou}}:{{min}}:{{sec}}</view>
 			  <view v-if="type == 1" @click="shareClick" class="offered-but font-color-FFF flex-items-plus mar-top-60">邀请好友拼单</view>
 			  <view v-if="type == 0" @click="getOffered" class="offered-but font-color-FFF flex-items-plus mar-top-60">立即参团</view>

+ 3 - 0
pages_category_page1/orderModule/afterSaleApply.vue

@@ -97,6 +97,9 @@ export default {
   onLoad(options) {
     this.item = JSON.parse(options.item)
     this.distribution = this.item.skus[0].distribution
+    if([2].includes(this.item.state)){
+      this.distribution = 1
+    }
     this.evaluated = options.isAllSelect
     // this.item.skus.forEach((item) => {
     //   this.number = this.number + item.number

+ 20 - 20
pages_category_page1/orderModule/index.vue

@@ -2,12 +2,7 @@
 <template>
   <view class="container">
     <global-loading />
-    <Skeleton
-        el-color="#efefef"
-        bg-color="#fff"
-        :loading="loading"
-        :animation="true"
-    />
+
     <view style="padding-bottom:68upx;">
       <u-sticky
           bg-color="#fff"
@@ -23,6 +18,12 @@
         />
       </u-sticky>
       <view class="order-list-box u-skeleton">
+        <Skeleton
+            el-color="#efefef"
+            bg-color="#fff"
+            :loading="loading"
+            :animation="true"
+        />
         <view
             class="item ske-loading u-skeleton-fillet"
             v-for="(orderItem, orderIndex) in list"
@@ -194,11 +195,11 @@ export default {
     if (options.type) {
       this.tabCurrentType = options.type
       this.orderState = options.type
+    }else{
+      this.orderState = ''
     }
-    this.handleRefreshList()
   },
-  onShow(){
-    console.log("show")
+  onShow() {
     // #ifdef H5
     const pageList = getCurrentPages();//获取应用页面栈
     const {options} = pageList[pageList.length - 1];//获取当前页面信息
@@ -206,8 +207,8 @@ export default {
       this.tabCurrentType = options.type
       this.orderState = options.type
     }
+    // #
     this.handleRefreshList()
-    // #endif
   },
   onReachBottom() {
     ++this.page
@@ -238,7 +239,7 @@ export default {
      * @param tabIndex
      */
     async handleTabChange(tabIndex) {
-      if(this.loading)return
+      if (this.loading) return
       this.tabCurrentType = tabIndex;
       this.orderState = this.tabList[tabIndex].number
       await this.handleRefreshList()
@@ -521,7 +522,7 @@ export default {
      * @param params
      */
     handleChangePayItem(params) {
-      const {payObj: {payInfo}} = this
+      const {payInfo} = this.payObj
       payInfo.paymentMode = params.paymentMode
       payInfo.huabeiPeriod = params.huabeiPeriod
     },
@@ -533,14 +534,12 @@ export default {
      */
     async handlePayOrder(orderItem) {
       const {orderPrice, collageId, orderId} = orderItem
-      const {payObj} = this
+      const {payObj} = this,payInfo = payObj.payInfo
       payObj.totalPrice = orderPrice
-      payObj.payInfo = {
-        collageId: collageId,
-        money: orderPrice,
-        orderId: orderId,
-        type: 2
-      }
+      payInfo.collageId =collageId
+      payInfo.money =orderPrice
+      payInfo.orderId =orderId
+      payInfo.type =2
       payObj.showPayPopup = true
     },
 
@@ -549,6 +548,7 @@ export default {
      */
     async handleGoPay() {
       const {payObj} = this
+      console.log('支付', payObj.payInfo)
       await handleDoPay(this.payObj.payInfo)
       payObj.showPayPopup = false
       payObj.totalPrice = 0
@@ -721,7 +721,7 @@ export default {
 <style lang="scss">
 .tabs {
   position: relative;
-  z-index: 9999;
+  z-index: 999999;
 }
 
 page {

+ 2 - 113
pages_category_page1/orderModule/orderConfirm.vue

@@ -410,71 +410,6 @@
           </view>
         </view>
       </u-popup>
-      <u-popup
-          class="huabei-popup"
-          v-model="showHuabeiPopup"
-          mode="bottom"
-          border-radius="14"
-          close-icon-pos="top-right"
-          close-icon-size="20"
-      >
-        <view class="huabei-box">
-          <radio-group
-              @change="huabeiPeriodChange"
-              v-model="huabeiPeriod"
-          >
-            <view class="period-radio">
-              <view class="period-amount">
-                <label class="period-each">¥ {{ fenqiFeeList[0]|clip2Decimal }}x3期</label>
-                <label class="period-each-charge">手续费¥{{ chargeFeeList[0]|clip2Decimal }}/期</label>
-              </view>
-              <radio
-                  class="period-type-radio-item"
-                  style="transform:scale(0.7)"
-                  :checked="huabeiPeriod == 3"
-                  value="3"
-              />
-            </view>
-            <view class="period-radio">
-              <view class="period-amount">
-                <label class="period-each">¥ {{ fenqiFeeList[1]|clip2Decimal }}x6期</label>
-                <label class="period-each-charge">手续费¥{{ chargeFeeList[1]|clip2Decimal }}/期</label>
-              </view>
-              <radio
-                  class="period-type-radio-item"
-                  style="transform:scale(0.7)"
-                  :checked="huabeiPeriod == 6"
-                  value="6"
-              />
-            </view>
-            <view class="period-radio">
-              <view class="period-amount">
-                <label class="period-each">¥ {{ fenqiFeeList[2]|clip2Decimal }}x12期</label>
-                <label class="period-each-charge">手续费¥{{ chargeFeeList[2]|clip2Decimal }}/期</label>
-              </view>
-              <radio
-                  class="period-type-radio-item"
-                  style="transform:scale(0.7)"
-                  :checked="huabeiPeriod == 12"
-                  value="12"
-              />
-            </view>
-          </radio-group>
-        </view>
-        <view class="huabei-confirm">
-          <view class="fenqi-total-amount">
-            <label class="fenqi-all">分期总额 ¥{{ (totalPrice - reduceMoney)|clip2Decimal }}</label>
-            <label class="charge-fee-all">手续费 ¥{{ chargeFee|clip2Decimal }}</label>
-          </view>
-          <view class="fenqi-confirm">
-            <text
-                class="btn active"
-                @click="showHuabeiPopup=false"
-            >确认
-            </text>
-          </view>
-        </view>
-      </u-popup>
     </view>
   </view>
 </template>
@@ -525,7 +460,6 @@ export default {
       shopCheckedType: true,
       discountPrice: 0,
       selectShopCoupon: [], // 已选择店铺优惠券
-      chargeFee: 0,  //花呗分期手续费,如果是商户支付手续费,则为0,否则默认计算3期手续费
       huabeiDetail: true,
       showHuabeiPopup: false,
       huabeiChargeType: 0,
@@ -559,7 +493,6 @@ export default {
     if (options.receiveId) {
       this.receiveId = options.receiveId
     }
-    this.decidePayType()
   },
   onShow() {
     if (uni.getStorageSync("receiveItem")) {
@@ -1045,7 +978,7 @@ export default {
       this.settlement.shops.forEach((item) => {
         this.totalPrice = this.totalPrice + (item.distribution.distributionPrice || 0)
       })
-      this.recalcHuabei()
+      //this.recalcHuabei()
     },
     calcCredit() {
       let shopsLen = this.settlement.shops.length
@@ -1158,25 +1091,6 @@ export default {
       }
       return skuRemainMap
     },
-    recalcHuabei() {
-      if (this.paymentMode === 3) {
-        this.fenqiFeeList[0] = this.totalPrice * (1 + this.huabeiFeerateList[0] / 100) / 3
-        this.fenqiFeeList[1] = this.totalPrice * (1 + this.huabeiFeerateList[1] / 100) / 6
-        this.fenqiFeeList[2] = this.totalPrice * (1 + this.huabeiFeerateList[2] / 100) / 12
-
-        this.chargeFeeList[0] = this.totalPrice * (this.huabeiFeerateList[0] / 100) / 3
-        this.chargeFeeList[1] = this.totalPrice * (this.huabeiFeerateList[1] / 100) / 6
-        this.chargeFeeList[2] = this.totalPrice * (this.huabeiFeerateList[2] / 100) / 12
-
-        var index = 0;
-        if (this.huabeiPeriod === 6) {
-          index = 1
-        } else if (this.huabeiPeriod === 12) {
-          index = 2
-        }
-        this.chargeFee = (this.totalPrice * (this.huabeiFeerateList[index] / 100)).toFixed(2)
-      }
-    },
     // 展示平台端优惠券
     showDiscount() {
       // let shopifAdd = 1
@@ -1221,31 +1135,6 @@ export default {
     onshopClose() {
       this.isShopCoupons = false
     },
-    huabeiPeriodChange(event) {
-      this.huabeiPeriod = event.target.value
-      var feeRate = this.huabeiFeerateList[2]
-      if (this.huabeiPeriod === 3) {
-        feeRate = this.huabeiFeerateList[0]
-      } else if (this.huabeiPeriod === 6) {
-        feeRate = this.huabeiFeerateList[1]
-      }
-      this.chargeFee = (this.totalPrice * feeRate / 100).toFixed(2)
-    },
-    showHuabeiDetail() {
-      this.showHuabeiPopup = true
-    },
-    decidePayType() {
-      // #ifdef H5 || MP-WEIXIN || APP-PLUS
-      this.showWechatPayType = true
-      this.paymentMode = 1
-      // #endif
-
-      // #ifdef MP-ALIPAY
-      this.showAlipayPayType = true
-      this.showHuabeiPayType = true
-      this.paymentMode = 2
-      // #endif
-    },
 
 
     /**
@@ -1253,7 +1142,7 @@ export default {
      * @return {boolean}
      */
     handleCheckOrderForm() {
-      if (this.paymentMode === 0) {
+      if (!this.payObj.paymentMode) {
         uni.showToast({
           title: '请选择支付方式',
           icon: 'none'

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 498 - 484
pages_category_page1/orderModule/orderDetails.vue


+ 1 - 1
pages_category_page1/orderModule/paySuccessful.vue

@@ -81,7 +81,7 @@ export default {
   methods: {
     goToOrder() {
       uni.navigateTo({
-        url: '../orderModule/index?type=0'
+        url: '../orderModule/index'
       })
     },
     goToHome() {

+ 1 - 1
pages_category_page2/channelCoupon/index.vue

@@ -82,7 +82,7 @@
 </template>
 
 <script>
-import GlobalLoading from "../../components/GlobalLoading";
+import GlobalLoading from "../../components/diyLoading/index";
 const NET = require('../../utils/request')
 const API = require('../../config/api')
 export default {

+ 1 - 1
pages_category_page2/orderModule/returnDetails.vue

@@ -210,7 +210,7 @@
 </template>
 
 <script>
-	import GlobalLoading from "../../components/GlobalLoading";
+	import GlobalLoading from "../../components/diyLoading";
   const NET = require('../../utils/request')
 	const API = require('../../config/api')
 	export default {

+ 1 - 1
pages_category_page2/userModule/messageDetail.vue

@@ -12,7 +12,7 @@
 
 <script>
 	import parse from 'mini-html-parser2';
-  import GlobalLoading from "../../components/GlobalLoading";
+  import GlobalLoading from "../../components/diyLoading";
 	const NET = require('../../utils/request')
 	const API = require('../../config/api')
 	export default {

+ 25 - 11
utils/payUtil.js

@@ -118,6 +118,7 @@ async function h5Pay(payInfo) {
         await payH5InEquipment(payInfo)
     }
 }
+
 // #endif
 
 // #ifdef MP-ALIPAY
@@ -174,6 +175,7 @@ async function aliPay(payInfo) {
         uni.hideLoading()
     }
 }
+
 // #endif
 
 // #ifdef MP-WEIXIN
@@ -182,7 +184,8 @@ async function aliPay(payInfo) {
  * @param payInfo
  * @return {Promise<void>}
  */
-async function wechatPay(payInfo){
+async function wechatPay(payInfo) {
+    console.log('进入微信支付')
     try {
         const res = await NET.request(API.gotoPay, payInfo, 'POST')
         uni.requestPayment({
@@ -192,7 +195,7 @@ async function wechatPay(payInfo){
             package: res.data.package,
             signType: res.data.signType,
             paySign: res.data.paySign,
-            success:  async (payRes)=> {
+            success: async (payRes) => {
                 // 拼团微信支付成功回调
                 if (payInfo.collageId) {
                     await NET.request(API.paySuccess, {
@@ -219,7 +222,7 @@ async function wechatPay(payInfo){
                 })
             }
         })
-    }catch(e){
+    } catch (e) {
         uni.showToast({
             title: '微信支付拉起失败',
             icon: 'none'
@@ -229,6 +232,7 @@ async function wechatPay(payInfo){
         })
     }
 }
+
 // #endif
 
 // #ifdef APP-PLUS
@@ -237,7 +241,7 @@ async function wechatPay(payInfo){
  * @param payInfo
  * @return {Promise<void>}
  */
-async function appWechatPay(payInfo){
+async function appWechatPay(payInfo) {
     try {
         const res = await NET.request(API.gotoAppPay, payInfo, 'POST')
         const obj = {
@@ -284,30 +288,33 @@ async function appWechatPay(payInfo){
         uni.hideLoading()
     }
 }
+
 // #endif
 
 /**
  * 处理支付
  * @param submitResult 结算结果
  */
-export async function handleDoPay(submitResult){
+export async function handleDoPay(submitResult) {
     uni.showLoading({
         mask: true,
         title: '支付中...',
     })
+    console.log('进入支付')
     const {paymentMode} = submitResult
-    if(paymentMode === 1){
+    if (paymentMode === 1) {
         // 微信支付
         // #ifdef APP-PLUS
         await appWechatPay(submitResult)
         // #endif
         // #ifdef MP-WEIXIN
+        console.log('进入微信支付')
         await wechatPay(submitResult)
         // #endif
         // #ifdef H5
         await h5Pay(submitResult)
         // #endif
-    }else if([2,3].includes(paymentMode)){
+    } else if ([2, 3].includes(paymentMode)) {
         // 支付宝
         // #ifdef MP-ALIPAY
         await aliPay(submitResult)
@@ -318,8 +325,15 @@ export async function handleDoPay(submitResult){
         throw new Error('支付宝相关支付暂时只支持支付宝小程序')
         // #endif
     }
-    uni.navigateTo({
-        url: '/pages_category_page1/orderModule/index?type=2'
-    })
-    this.$hideLoading()
+    setTimeout(()=>{
+        uni.navigateTo({
+            url: '/pages_category_page1/orderModule/index?type=2'
+        })
+    },1000)
+    /*  uni.navigateTo({
+          url: '/pages_category_page1/orderModule/index?type=2'
+      })*/
+    // uni.hideLoading()
+
+
 }

+ 1 - 1
utils/request.js

@@ -1,4 +1,4 @@
-import {showLoading,hideLoading} from "../components/GlobalLoading";
+import {showLoading,hideLoading} from "./plugIn/globalLoading";
 const request = (url, data, method = 'GET') => {
 	return new Promise((resolve, reject) => {
 		let header = {

+ 2 - 1
utils/services.js

@@ -78,7 +78,8 @@ export function Services(shopId) {
         }
         // #endif
         // #ifdef H5
-        window.open(serviceURL)
+        // window.open(serviceURL) safari浏览器不支持window.open
+        window.location.href = serviceURL
         // #endif
     }
 

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott