hmp 4 years ago
parent
commit
08079a6883

+ 18 - 0
pages.json

@@ -223,6 +223,24 @@
             }
             
         }
+        ,{
+            "path" : "pages/material-download/material-download",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "物料下载",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/material-download/test",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "物料下载",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 150 - 0
pages/material-download/comps/mp-swiper.vue

@@ -0,0 +1,150 @@
+<template>
+	<view class="swiper">
+		<view class="swiper-title">
+			<swiper :style="{height:fullHeight}" class="swiper-tall" :indicator-dots="indicatorDots"
+				:autoplay="autoplay" :previous-margin="previousMargin" :next-margin="nextMargin" :circular="circular"
+				@change="change" :current="swiperCurrentIndex">
+				<swiper-item class="swiper-container" v-for="(item,index) in list" :key="index" :item-id="index"
+					:data-year="index">
+					<view :animation="animationData[index]" class="swiper-item" style="position: relative;">
+						<image :src="item.image" mode=""></image>
+						<view class="content">
+							<text class="">{{shopDetail.name}}</text>
+							<tki-qrcode style="margin-top: -100rpx;" cid="1" ref="qrcode-charge" :val="shopDetail.id" size="260" :onval="true"
+								:loadMake="true" :usingComponents="true" />
+						</view>
+
+					</view>
+				</swiper-item>
+			</swiper>
+		</view>
+
+		<view class="center">
+			<view class="cu-btn  flex round text-lg"
+				style="padding: 46rpx 0;background-color: #EF9944;color: #FFFFFF;width: 76%;">
+				生成海报
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+	import tkiQrcode from "tki-qrcode"
+	export default {
+		props: {
+			list: Array
+		},
+		components: {
+			tkiQrcode
+		},
+		data() {
+			return {
+				screenHeight: 0,
+				animationData: {
+					0: {},
+					1: {},
+					2: {},
+					3: {}
+				},
+				title: '0',
+				indicatorDots: false,
+				autoplay: false,
+				previousMargin: uni.upx2px(82) + 'px',
+				nextMargin: uni.upx2px(82) + 'px',
+				circular: true,
+				zoomParam: 1.10,
+				swiperCurrentIndex: 0,
+				data: [],
+				max: 0,
+				//商户详情
+
+				shopDetail: {}
+			}
+		},
+		computed: {
+			fullHeight() {
+				const res = uni.getSystemInfoSync();
+				return res.windowHeight - (res.statusBarHeight + 44) + 'px';
+			}
+		},
+		async mounted(option) {
+			let res = await this.$api.shop.detail({
+				id: this.vuex_shopId
+			})
+			this.shopDetail = res.data
+		},
+		created() {
+			this.animation = uni.createAnimation();
+			this.animation.scale(this.zoomParam).step();
+			this.animationData[0] = this.animation.export();
+		},
+		methods: {
+			change(e) {
+				this.swiperCurrentIndex = e.detail.current;
+				this.title = e.detail.currentItemId;
+				for (let key in this.animationData) {
+					if (e.detail.currentItemId == key) {
+						this.animation.scale(this.zoomParam).step();
+						this.animationData[key] = this.animation.export();
+					} else {
+						this.animation.scale(1.0).step();
+						this.animationData[key] = this.animation.export();
+					}
+				}
+				this.$emit('change', this.swiperCurrentIndex)
+			}
+		}
+	}
+</script>
+
+<style>
+	page {
+		display: flex;
+		flex-wrap: wrap;
+	}
+
+	.content {
+		position: absolute;
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		top: 30rpx;
+	}
+
+
+	.save-btn {
+		background-color: #EF9944;
+		color: #FFFFFF;
+	}
+
+	.swiper-container {
+		display: flex;
+		align-items: center;
+	}
+
+	.swiper-item {
+		display: flex;
+		flex-wrap: wrap;
+		justify-content: center;
+		margin-left: auto;
+		margin-right: auto;
+		height: 760upx;
+		width: 544upx;
+		line-height: 300upx;
+		text-align: center;
+		margin-bottom: 50upx;
+	}
+
+
+
+	.swiper-tall {
+		display: flex;
+		align-items: center;
+	}
+
+	.swiper-title {
+		margin-top: -100rpx;
+		width: 760upx;
+		text-align: center;
+	}
+</style>

+ 525 - 0
pages/material-download/material-download.vue

@@ -0,0 +1,525 @@
+<template>
+    <view class="poster_page">
+		<mp-swiper :list="list"></mp-swiper>
+		<!-- <swiper class="poster_swiper" previous-margin="110rpx" circular :current="swiperIndex" next-margin="110rpx" @change="onSwiperChange">
+		    <swiper-item v-for="(item, index) of list" :key="index">
+		        <view class="goods_info_box" :class="{ active: swiperIndex == index }">
+		            <image class="goods_image" :src="item.image" mode="scaleToFill"></image>
+		        </view>
+		    </swiper-item>
+		</swiper> -->
+        <!-- <canvas canvas-id="poster" class="poster_canvas"></canvas> -->
+       
+<!--        <view class="share_save_box">
+			<view class="push_button" @click="onSaveImg">
+				<text style="font-size: 28rpx;">保存图片</text>
+			</view>
+        </view> -->
+    </view>
+</template>
+<script>
+// 文字换行
+function drawtext(text, maxWidth) {
+    let textArr = text.split("");
+    let len = textArr.length;
+    // 上个节点
+    let previousNode = 0;
+    // 记录节点宽度
+    let nodeWidth = 0;
+    // 文本换行数组
+    let rowText = [];
+    // 如果是字母,侧保存长度
+    let letterWidth = 0;
+    // 汉字宽度
+    let chineseWidth = 21;
+    // otherFont宽度
+    let otherWidth = 10.5;
+    for (let i = 0; i < len; i++) {
+        if (/[\u4e00-\u9fa5]|[\uFE30-\uFFA0]/g.test(textArr[i])) {
+            if(letterWidth > 0){
+                if(nodeWidth + chineseWidth + letterWidth * otherWidth > maxWidth){
+                    rowText.push({
+                        type: "text",
+                        content: text.substring(previousNode, i)
+                    });
+                    previousNode = i;
+                    nodeWidth = chineseWidth;
+                    letterWidth = 0;
+                } else {
+                    nodeWidth += chineseWidth + letterWidth * otherWidth;
+                    letterWidth = 0;
+                }
+            } else {
+                if(nodeWidth + chineseWidth > maxWidth){
+                    rowText.push({
+                        type: "text",
+                        content: text.substring(previousNode, i)
+                    });
+                    previousNode = i;
+                    nodeWidth = chineseWidth;
+                }else{
+                    nodeWidth += chineseWidth;
+                }
+            }
+        } else {
+            if(/\n/g.test(textArr[i])){
+                rowText.push({
+                    type: "break",
+                    content: text.substring(previousNode, i)
+                });
+                previousNode = i + 1;
+                nodeWidth = 0;
+                letterWidth = 0;
+            }else if(textArr[i] == "\\" && textArr[i + 1] == "n"){
+                rowText.push({
+                    type: "break",
+                    content: text.substring(previousNode, i)
+                });
+                previousNode = i + 2;
+                nodeWidth = 0;
+                letterWidth = 0;
+            }else if(/[a-zA-Z0-9]/g.test(textArr[i])){
+                letterWidth += 1;
+                if(nodeWidth + letterWidth * otherWidth > maxWidth){
+                    rowText.push({
+                        type: "text",
+                        content: text.substring(previousNode, i + 1 - letterWidth)
+                    });
+                    previousNode = i + 1 - letterWidth;
+                    nodeWidth = letterWidth * otherWidth;
+                    letterWidth = 0;
+                }
+            } else{
+                if(nodeWidth + otherWidth > maxWidth){
+                    rowText.push({
+                        type: "text",
+                        content: text.substring(previousNode, i)
+                    });
+                    previousNode = i;
+                    nodeWidth = otherWidth;
+                }else{
+                    nodeWidth += otherWidth;
+                }
+            }
+        }
+    }
+    if (previousNode < len) {
+        rowText.push({
+            type: "text",
+            content: text.substring(previousNode, len)
+        });
+    }
+    return rowText;
+}
+let settingWritePhotosAlbum = false;
+
+import mpSwiper from "./comps/mp-swiper.vue"
+export default {
+	components:{
+		mpSwiper
+	},
+    data() {
+        return {
+			type:'',
+			list:[
+				{
+					title:'麻辣烫',
+					image:'/static/icon/wuliao1.png'
+				},
+				{
+					title:'麻辣烫',
+					image:'/static/icon/wuliao1.png'
+				},
+				{
+					title:'麻辣烫',
+					image:'/static/icon/wuliao1.png'
+				},
+				{
+					title:'麻辣烫',
+					image:'/static/icon/wuliao1.png'
+				},
+				{
+					title:'麻辣烫',
+					image:'/static/icon/wuliao1.png'
+				}
+			],
+			cardCur:0,
+			//平台
+			platformName: "联兑通",
+			recommendCodeGoods: "",
+			//二维码
+            swiperIndex: 0,
+            posterImgs: [],
+            h5SaveImg: ""
+        };
+    },
+    onLoad(options) {
+		
+    },
+    computed: {
+    },
+    //方法
+    methods: {
+		cardSwiper(e){
+			console.log(e);
+		},
+		fetchData1(id){
+			this.$request.get(myApi.live.page,{params:{size:300,id:id}}).then(res=>{
+				this.list=[]
+				res.data.records.forEach(item=>{
+					let obj={}
+					obj.headImgs=item.pic
+					if(item.account>-0.000001&&item.account<0.000001){
+						obj.goodsPrice="免费观看"
+					}else{
+						obj.goodsPrice=item.account
+					}
+					obj.goodsName=item.title
+					obj.id=item.id
+					this.list.push(obj)
+				})
+				this.getAccessToken()
+			})
+		},
+        // 轮播图变化
+        onSwiperChange(e) {
+            this.swiperIndex = e.detail.current;
+			this.getAccessToken()
+        },
+        // 创建海报
+        createPoster() {
+            return new Promise((resolve, reject) => {
+                uni.showLoading({
+                    title: '海报生成中'
+                });
+                const ctx = uni.createCanvasContext('poster');
+                ctx.fillRect(0, 0, 375, 673);
+                ctx.setFillStyle("#FFF");
+                ctx.fillRect(0, 0, 375, 673);
+                uni.downloadFile({
+                    url: this.list[this.swiperIndex].headImgs,
+                    success: (res) => {
+                        if (res.statusCode === 200) {
+                            ctx.drawImage(res.tempFilePath, 0, 0, 375, 375);
+                            uni.downloadFile({
+                                url: this.recommendCodeGoods,
+                                success: (res2) => {
+                                    if (res.statusCode === 200) {
+                                        // 商品标题
+                                        ctx.setFontSize(16);
+                                        ctx.setFillStyle('#333');
+                                        let drawtextList = drawtext(this.list[this.swiperIndex].goodsName, 420);
+                                        let textTop = 0;
+                                        drawtextList.forEach((item,index) => {
+                                            if(index < 2){
+                                                textTop = 380 + (index + 1) * 28;
+												if(index==0){
+													ctx.fillText(item.content, 22, textTop);
+												}else{
+													if(item.content.length>20){
+														ctx.fillText(item.content+"...", 22, textTop);
+													}else{
+														ctx.fillText(item.content, 22, textTop);
+													}
+												}
+                                            }
+                                        });
+                                        // 商品价格
+                                        ctx.setFontSize(20);
+                                        ctx.setFillStyle('#f00');
+                                        ctx.fillText(this.list[this.swiperIndex].goodsPrice, 17, textTop + 47);
+                                        // 商品分割线
+                                        ctx.beginPath();
+                                        ctx.setLineWidth(1);
+                                        ctx.moveTo(17, textTop + 70);
+                                        ctx.lineTo(358, textTop + 70);
+                                        ctx.setStrokeStyle('#eee');
+                                        ctx.stroke();
+                                        // 长按识别二维码访问
+                                        ctx.setFontSize(14);
+                                        ctx.setFillStyle('#333');
+                                        ctx.fillText("扫描二维码访问", 17, textTop + 136);
+                                        // 平台名称
+                                        ctx.setFontSize(12);
+                                        ctx.setFillStyle('#999');
+                                        ctx.fillText(this.platformName, 17, textTop + 170);
+                                        // 二维码
+                                        ctx.drawImage(res2.tempFilePath, 238, textTop + 88, 120, 120);
+                                        ctx.draw(true, () => {
+                                            // canvas画布转成图片并返回图片地址
+                                            uni.canvasToTempFilePath({
+                                                canvasId: 'poster',
+                                                width: 375,
+                                                height: 673,
+                                                success: (res) => {
+                                                    if(this.posterImgs[this.swiperIndex]){
+                                                        this.posterImgs[this.swiperIndex].temporary = res.tempFilePath;
+                                                    }else{
+                                                        this.posterImgs[this.swiperIndex] = {
+                                                            temporary: res.tempFilePath
+                                                        };
+                                                    }
+                                                    console.log("海报制作成功!");
+                                                    resolve(res.tempFilePath);
+                                                },
+                                                fail: () => {
+                                                    uni.hideLoading();
+                                                    reject();
+                                                }
+                                            })
+                                        });
+                                    } else {
+                                        uni.hideLoading();
+                                        uni.showToast({
+                                            title: '海报制作失败,图片下载失败',
+                                            icon: 'none'
+                                        });
+                                    }
+                                },
+                                fail: err => {
+                                    uni.hideLoading();
+                                    uni.showToast({
+                                        title: '海报制作失败,图片下载失败',
+                                        icon: 'none'
+                                    });
+                                }
+                            });
+                        } else {
+                            uni.hideLoading();
+                            uni.showToast({
+                                title: '海报制作失败,图片下载失败',
+                                icon: 'none'
+                            });
+                        }
+                    },
+                    fail: err => {
+                        uni.hideLoading();
+                        uni.showToast({
+                            title: '海报制作失败,图片下载失败',
+                            icon: 'none'
+                        });
+                    }
+                });
+            });
+        },
+        // 保存图片
+        async onSaveImg() {
+            let imgUrl = "";
+            if(this.posterImgs[this.swiperIndex] && this.posterImgs[this.swiperIndex].temporary){
+                imgUrl = await this.posterImgs[this.swiperIndex].temporary;
+            }else{
+                imgUrl = await this.createPoster();
+            }
+            // #ifdef H5
+            this.h5SaveImg = imgUrl;
+            uni.hideLoading();
+            // #endif
+            // #ifdef MP-WEIXIN
+            uni.showLoading({
+                title: '海报下载中'
+            });
+            if (settingWritePhotosAlbum) {
+                uni.getSetting({
+                    success: res => {
+                        if (res.authSetting['scope.writePhotosAlbum']) {
+                            uni.saveImageToPhotosAlbum({
+                                filePath: imgUrl,
+                                success: () => {
+                                    uni.showToast({
+                                        title: '保存成功'
+                                    });
+                                },
+                                complete: () => {
+                                    uni.hideLoading();
+                                }
+                            });
+                        } else {
+                            uni.showModal({
+                                title: '提示',
+                                content: '请先在设置页面打开“保存相册”使用权限',
+                                confirmText: '去设置',
+                                cancelText: '算了',
+                                success: data => {
+                                    if (data.confirm) {
+                                        uni.openSetting();
+                                    }
+                                },
+                                complete: () => {
+                                    uni.hideLoading();
+                                }
+                            });
+                        }
+                    },
+                    complete: () => {
+                        uni.hideLoading();
+                    }
+                });
+            } else {
+                settingWritePhotosAlbum = true;
+                uni.authorize({
+                    scope: 'scope.writePhotosAlbum',
+                    success: () => {
+                        uni.saveImageToPhotosAlbum({
+                            filePath: imgUrl,
+                            success: () => {
+                                uni.showToast({
+                                    title: '保存成功'
+                                });
+                            },
+                            complete: () => {
+                                uni.hideLoading();
+                            }
+                        });
+                    },
+                    complete: () => {
+                        uni.hideLoading();
+                    }
+                });
+            }
+            // #endif
+            // #ifdef APP-PLUS
+            uni.showLoading({
+                title: '海报下载中'
+            });
+            uni.saveImageToPhotosAlbum({
+                filePath: imgUrl,
+                success: () => {
+                    uni.hideLoading();
+                    uni.showToast({
+                        title: '保存成功'
+                    });
+                }
+            });
+            // #endif
+        }
+    }
+};
+</script>
+<style lang="scss" scoped>
+.poster_page {
+    min-height: 100vh;
+    background-color: #f5f5f5;
+}
+.poster_canvas {
+    width: 750rpx;
+    height: 1324rpx;
+    position: fixed;
+    top: -10000rpx;
+    left: 0rpx;
+}
+.poster_swiper {
+    height: 950rpx;
+    width: 100%;
+    swiper-item {
+        box-sizing: border-box;
+        display: flex;
+        align-items: center;
+        .goods_info_box {
+            width: 100%;
+            height: 100%;
+            transform: scale(0.88);
+            transition: all 0.4s;
+            position: relative;
+            overflow: hidden;
+            background-color: #FFFFFF;
+            &.active {
+                transform: scale(1);
+            }
+            .goods_image {
+                width: 100%;
+                height: calc(100vw - 220rpx);
+            }
+            .goods_info {
+                padding: 24rpx;
+                .goods_name {
+                    color: #333;
+                    font-size: 30rpx;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					display: -webkit-box;
+					-webkit-line-clamp: 2;
+					-webkit-box-orient: vertical;
+                }
+                .price_box {
+                    margin-top: 24rpx;
+                    display: flex;
+                    align-items: center;
+                    .price {
+                        font-size: 38rpx;
+                        color: red;
+                    }
+                    .store_price {
+                        margin-left: 30rpx;
+                        font-size: 26rpx;
+                        color: #999;
+                        text-decoration: line-through;
+                    }
+                }
+                .poster_info {
+                    border-top: 2rpx solid #f1f1f1;
+                    padding-top: 24rpx;
+                    margin-top: 24rpx;
+                    display: flex;
+                    align-items: center;
+                    justify-content: space-between;
+                    .info {
+                        display: flex;
+                        flex-direction: column;
+                        view {
+                            color: #333;
+                            font-size: 28rpx;
+                        }
+                        text {
+                            color: #999;
+                            font-size: 24rpx;
+                            margin-top: 20rpx;
+                        }
+                    }
+                    .poster_code_image {
+                        width: 170rpx;
+                        height: 170rpx;
+                        flex-shrink: 0;
+                    }
+                }
+            }
+        }
+    }
+}
+.push_button{
+	position:relative;
+	color:#FFF;
+	display:block;
+	text-decoration:none;
+	margin:0 auto;
+	border-radius:40rpx;
+	text-align:center;
+	padding:12rpx 80rpx;
+	-webkit-transition: all 0.1s;
+	-moz-transition: all 0.1s;
+	transition: all 0.1s;
+	
+	background-color: rgba(232, 0, 0,.7);
+	-webkit-box-shadow: 2px 4px 2px rgba(232, 0, 0,.5);
+	-moz-box-shadow: 2px 4px 2px rgba(232, 0, 0,.5);
+	box-shadow: 2px 4px 2px rgba(232, 0, 0,.5);
+}
+.push_button:active{
+	-webkit-box-shadow: 0px 2px 0px rgba(232, 0, 0,.5);
+	-moz-box-shadow: 0px 2px 0px rgba(232, 0, 0,.5);
+	box-shadow: 0px 2px 0px rgba(232, 0, 0,.5);
+	position:relative;
+	top:7px;
+}
+
+
+.share_save_box {
+    position: fixed;
+    bottom: calc((100vh - 950rpx - 140rpx) / 4);
+    left: 0;
+    z-index: 6;
+    width: 100%;
+    display: flex;
+}
+</style>
+
+

+ 125 - 0
pages/material-download/test.vue

@@ -0,0 +1,125 @@
+<template>
+	<view class="swiper">
+		<view class="swiper-title" >
+			<swiper :style="{height:fullHeight}" class="swiper-tall" :indicator-dots="indicatorDots" :autoplay="autoplay" :previous-margin="previousMargin"
+			 :next-margin="nextMargin" :circular="circular" @change="change" :current="swiperCurrentIndex">
+				<swiper-item class="swiper-container" v-for="(item,index) in imgs" :key="index"
+				 :item-id="index" :data-year="index">
+				 
+				<view class="swiper-item">
+					<image :animation="animationData[index]" :src="item" mode=""></image>
+				</view>
+				</swiper-item>
+			</swiper>
+		</view>
+		
+		<view class="center">
+			<view class="cu-btn  flex round text-lg" style="padding: 46rpx 0;background-color: #EF9944;color: #FFFFFF;width: 76%;">
+				生成海报
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+	export default {
+		data() {
+			return {
+				screenHeight: 0,
+				animationData: {
+					0:{},
+					1:{},
+					2:{}
+				},
+				title: '0',
+				indicatorDots: false,
+				autoplay: false,
+				previousMargin: uni.upx2px(82)+'px',
+				nextMargin: uni.upx2px(82)+'px',
+				circular: true,
+				zoomParam: 1.10,
+				swiperCurrentIndex: 0,
+				data: [],
+				max: 0,
+				imgs:[
+					'/static/icon/wuliao.png',
+					'/static/icon/wuliao.png',
+					'/static/icon/wuliao.png',
+					'/static/icon/wuliao.png',
+				]
+			}
+		},
+		computed:{
+			fullHeight() {
+				const res = uni.getSystemInfoSync();
+				return res.windowHeight  - (res.statusBarHeight+44)+'px';
+			}
+		},
+		onLoad() {
+			this.animation = uni.createAnimation();
+			this.animation.scale(this.zoomParam).step();
+			this.animationData[0] = this.animation.export();
+		},
+		methods: {
+			change(e) {
+				this.swiperCurrentIndex = e.detail.current;
+				this.title = e.detail.currentItemId;
+				for (let key in this.animationData) {
+					if (e.detail.currentItemId == key) {
+						this.animation.scale(this.zoomParam).step();
+						this.animationData[key] = this.animation.export();
+					} else {
+						this.animation.scale(1.0).step();
+						this.animationData[key] = this.animation.export();
+					}
+				}
+				this.$emit('change',this.swiperCurrentIndex)
+			}
+		}
+	}
+</script>
+
+<style>
+	page{
+		display: flex;
+		flex-wrap: wrap;  
+	}
+	
+	
+	
+	.save-btn{
+		background-color: #EF9944;
+		color: #FFFFFF;
+	}
+	
+	.swiper-container {
+		display: flex;
+		align-items: center;
+	}
+
+	.swiper-item {
+		display: flex;
+		flex-wrap: wrap;
+		justify-content: center;
+		margin-left: auto;
+		margin-right: auto;
+		height: 760upx;
+		width: 544upx;
+		line-height: 300upx;
+		text-align: center;
+		margin-bottom: 50upx;
+	}
+
+
+
+	.swiper-tall {
+		display: flex;
+		align-items: center;
+	}
+
+	.swiper-title {
+		margin-top: -100rpx;
+		width: 760upx;
+		text-align: center;
+	}
+
+</style>

+ 25 - 7
pages/pay/pay.vue

@@ -31,7 +31,8 @@
 				scanNotify:{scan: false,scanMessage:'扫描错误,请稍后重试!' },
 				money:'',
 				//向哪个用户收款
-				userId:{}
+				secret:'',
+				userId:''
 			}
 		},
 		onLoad(options) {
@@ -44,7 +45,11 @@
 					onlyFromCamera:true,
 					scanType: ['barCode'],
 				    success: function (res) {
-						_this.payBefore(res.result)
+						//用户id
+						_this.secret=res.result
+						_this.userId=_this.secret.substr(0,19)
+						//处理支付
+						_this.handelPay()
 				    },
 					fail: (res) => {
 						if(res.errMsg!='scanCode:fail cancel'){
@@ -53,8 +58,21 @@
 					}
 				});
 			},
-			async payBefore(secret){
-				
+			async handelPay(){
+				let res=await this.getPointPayType()
+				this.payBefore(res.data)
+			},
+			//获取积分策略
+			async getPointPayType(){
+				let params={
+					shopId: this.vuex_shopId,
+					loginUserId: this.userId,
+					money: this.money
+				}
+				let res=await this.$api.shop.getPointPayType(params)
+				return res
+			},
+			async payBefore(pointPayType){
 				let expireTime=this.$dateTime.getExpireTime(5)
 				let params={
 					shopId:this.vuex_shopId,
@@ -62,8 +80,9 @@
 					billsTitle:'用户支付',
 					expireTime,
 					appId:this.$global.wxParams.clientAppId,
-					secret,
-					type:2
+					secret:this.userId,
+					type:2,
+					pointPayType
 				}
 				let resp=await this.$api.shop.payBefore(params)
 				if (!resp.success) {
@@ -71,7 +90,6 @@
 					return
 				}
 				//发送通讯
-				this.userId=secret.substr(0,19)
 				this.sendInfo()
 				
 				this.$dialog.showModal('扫描成功,等待用户付款',false).then(()=>{

BIN
static/icon/wuliao1.png