Jelajahi Sumber

更新微信开放标签的样式

xueyihao 4 bulan lalu
induk
melakukan
ca29cd42fd

+ 22 - 5
src/components/webviewPoint.vue

@@ -7,11 +7,22 @@
       <button class="modal-cancel" @click="show = false">取消</button>
       <wx-open-launch-weapp
           id="launch-btn"
+          class="launch-weapp-btn"
           appid="wxab9634bf98628a03"
           :path="launchButtonHtml"
       >
         <script type="text/wxtag-template">
-          <button style="padding:10px;width:100%;background:#07c160;color:white;">去抽奖</button>
+          <style scoped>
+            .btn {
+              width: 100%;
+              height: 100%;
+              font-size: 1rem;
+              text-align: center;
+              margin: 0; padding: 0;
+              border: none;
+              background: none;
+              color: #FFFFFF; } </style>
+          <button class="btn">去抽奖</button>
         </script>
       </wx-open-launch-weapp>
     </view>
@@ -89,7 +100,7 @@ export default {
     width: 225rpx;
     height: 68rpx;
     border-radius: 60rpx;
-    font-size: 28rpx;
+    font-size: 1rem;
     text-align: center;
     line-height: 68rpx;
     margin: 0 20rpx;
@@ -101,9 +112,15 @@ export default {
     color: #333333;
   }
 
-  .modal-confirm {
-    width: 129px;
-    height: 38px;
+  .launch-weapp-btn {
+    width: 225rpx;
+    height: 68rpx;
+    border-radius: 60rpx;
+    margin: 0 20rpx;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background: linear-gradient(78deg, #1AD8CF 0%, #21C8C0 100%);
   }
 }
 </style>

+ 10 - 7
src/pages/order/comment.vue

@@ -16,8 +16,8 @@
 				</view>
 				<template v-if="title == '商户'">
 					<view class="tag">
-						<view class="word" 
-							v-for="(item, index) in jstag" :key="index" 
+						<view class="word"
+							v-for="(item, index) in jstag" :key="index"
 							@click="addJsComment(item)">
 							{{item.value}}
 						</view>
@@ -25,8 +25,8 @@
 				</template>
 				<template v-else>
 					<view class="tag">
-						<view class="word" 
-							v-for="(item, index) in tag" :key="index" 
+						<view class="word"
+							v-for="(item, index) in tag" :key="index"
 							@click="addComment(item)">
 							{{item.value}}
 						</view>
@@ -67,6 +67,7 @@
 				orderId: '',
 				openId: '',
 				name: '',
+        nickName:'',
 				nStar: 0,
 				title: '',
 				jstag: [{
@@ -102,8 +103,9 @@
 			this.orderNo = options.orderNo
 
 			this.jsId = options.cJsId
-			this.name = options.cNickName
+			this.name = options.cName
 
+      this.nickName = options.nickName
 			this.title = options.title
 			this.openId = options.cOpenId
 		},
@@ -124,11 +126,12 @@
 			submit() {
 				if (this.comment.trim() == '') return;
 				let params = {
+          openId:uni.getStorageSync('wx_copenid'),
 					orderId: this.orderId,
 					orderNo: this.orderNo,
 					jsId: this.jsId,
 					name: this.name,
-					nickName: 'xiaoxiao',
+					nickName: this.nickName,
 
 					star: this.nStar,
 					text: this.comment.trim(),
@@ -284,4 +287,4 @@
 
 		}
 	}
-</style>
+</style>

+ 7 - 3
src/pages/order/order.vue

@@ -135,9 +135,11 @@ export default {
 		this.isLogin = !!uni.getStorageSync('wx_copenid');
 	},
 	onShow() {
+    var _this = this;
     getIsLottery({types:[1,3]}).then(res=>{
-      if(res.data.data.isLottery === 1){
-        this.$refs.webviewRef?.getRow(res.data.data.activityId);
+      console.log(res.data.data)
+      if(res.data.data?.isLottery === 1){
+        _this.$refs.webviewRef?.getRow(res.data.data?.activityId);
       }
     })
 		this.getStatus()
@@ -305,11 +307,13 @@ export default {
 			});
 		},
 		goEvaluate(item) {
+      console.log(item)
 			let str = uni.$u.queryParams({
 				orderNo: item.orderNo,
 				cId: item.cId,
 				cJsId: item.cJsId,
-				cName: item.js.cName
+				cName: item.js.cName,
+        nickName:item.wxUser.nickName
 			});
 			uni.navigateTo({
 				url: `/pages/order/comment${str}`

+ 1 - 2
src/points/order/orderList.vue

@@ -22,8 +22,7 @@ export default {
   },
   mounted(){
     getIsLottery({types:[2]}).then(res=>{
-      console.log(res)
-      if(res.data.data.isLottery === 1){
+      if(res.data.data?.isLottery === 1){
         this.$refs.webviewRef?.getRow(res.data.data.activityId);
       }
     })

+ 1 - 12
src/utils/share.js

@@ -155,18 +155,7 @@ export async function handleServiceShare(shareData) {
 export async function handleServiceAdjustMiniProgram() {
   // 这里可以根据实际需求,调用后端接口获取微信 JS-SDK 配置
   let url = `${h5Url}/`
-  const res = await getSignature();
-  console.log(res)
-  // const res = {
-  //   data:{
-  //     appId:"wx9dc677bd41e82569",
-  //     jsapi_ticket : "xN-5lpdNhLiE7IEBU_UcHiyJbIL_nALi9KlPocS0cgHRtlLg8pID873P8yRAP2bAEy5nvorNMX2FW7F-2eh0gg",
-  //     nonceStr : "50784887-0393-401e-9933-94cd7185093d",
-  //     signature : "855a95d6cefc0496302d05398276c6395a608184",
-  //     timestamp: "1778206207",
-  //     url: "https://city.baoxianzhanggui.com/fragrance/"
-  //   }
-  // }
+  const res = await getSignature({url:url})
   // 假设已经获取到配置信息
   const wxConfig = {
     appId: res.data.appId, // 从后端获取