Просмотр исходного кода

fix(activity): 优化活动交互与失败提示

- 拼团创建失败时由页面展示完整提示,并统一延长请求错误提示时长
- 优化首页活动按钮尺寸,并让红包商品搜索使用指定匹配模式
- 补充 mallApp 编辑器类型检查配置,改善路径别名与 Vue 文件识别
shizhongqi 11 часов назад
Родитель
Сommit
7a416a5d94

+ 1 - 1
hdApp/src/admin/hb/list.vue

@@ -228,7 +228,7 @@ export default {
         this.showSearch = false
         return
       }
-      getList({ page: 1, name: value, type: 0 }).then((res) => {
+      getList({ page: 1, name: value, type: 0, searchStyle: 1 }).then((res) => {
         this.searchList = res.data && res.data.list ? res.data.list : []
         this.showSearch = true
       })

+ 6 - 2
mallApp/src/api/group-buy/index.js

@@ -10,8 +10,12 @@ export const getGoodsLanding = data => https.get('/group-buy/goods-landing', dat
 /** 指定拼团详情(分享进入用 id=groupBuyId) */
 export const getGroupDetail = data => https.get('/group-buy/detail', data)
 
-/** 我要开团 */
-export const createGroup = data => https.post('/group-buy/create', data)
+/**
+ * 我要开团
+ * @param {Object} data 业务参数
+ * @param {Object} config 请求控制,如 hideError 由页面自行弹失败提示(须透传到 post,否则第二参会被丢掉)
+ */
+export const createGroup = (data, config = {}) => https.post('/group-buy/create', data, {}, config)
 
 /**
  * 我要参团

+ 4 - 4
mallApp/src/components/home/activitySection.vue

@@ -384,11 +384,11 @@ export default {
 }
 .action-btn {
   flex-shrink: 0;
-  padding: 10upx 20upx;
-  font-size: 22upx;
+  padding: 13upx 24upx;
+  font-size: 24upx;
   color: #fff;
   background: linear-gradient(135deg, #FF8FA3, #FF4D6D);
-  border-radius: 30upx;
+  border-radius: 28upx;
   white-space: nowrap;
 }
 .price {
@@ -460,7 +460,7 @@ export default {
 }
 .grid-btn {
   margin-top: 10upx;
-  padding: 12upx 0;
+  padding: 13upx 0;
   text-align: center;
   font-size: 24upx;
   color: #fff;

+ 22 - 13
mallApp/src/pages/groupBuy/detail.vue

@@ -525,20 +525,29 @@ export default {
         activityGoodsId,
         goodsNum: 1,
         sendType: 1
+      },
+      { hideError: true }
+    ).then((res) => {
+        uni.hideLoading()
+        this.submitting = false
+        if (res.code === 1 && res.data) {
+          this.groupBuyId = res.data.groupBuyId
+          this.setupShare()
+          this.goPay(res.data)
+        }
+        if (res && res.msg) {
+          uni.showToast({
+            title: res.msg,
+            icon: 'none',
+            mask: true,
+            duration: 3000
+          })
+        }
+      })
+      .catch(() => {
+        uni.hideLoading()
+        this.submitting = false
       })
-        .then((res) => {
-          uni.hideLoading()
-          this.submitting = false
-          if (res.code === 1 && res.data) {
-            this.groupBuyId = res.data.groupBuyId
-            this.setupShare()
-            this.goPay(res.data)
-          }
-        })
-        .catch(() => {
-          uni.hideLoading()
-          this.submitting = false
-        })
     },
     joinOpenGroup() {
       if (!this.openGroup || !this.openGroup.id) return

+ 4 - 2
mallApp/src/plugins/luch-request_0.0.7/request.js

@@ -195,7 +195,8 @@ class Request {
 								uni.showToast({
 									title: response.data.msg,
 									icon: 'none',
-									mask: true
+									mask: true,
+									duration: 3000
 								})
 							}
 							reject(response.data)
@@ -216,7 +217,8 @@ class Request {
 								uni.showToast({
 									title: response.data.msg,
 									icon: 'none',
-									mask: true
+									mask: true,
+									duration: 3000
 								})
 							}
 							reject(response.data)

+ 31 - 0
mallApp/tsconfig.json

@@ -1,10 +1,41 @@
 {
   "compilerOptions": {
+    "target": "ESNext",
+    "module": "ESNext",
+    "moduleResolution": "bundler",
+    "allowJs": true,
+    "checkJs": false,
+    "noEmit": true,
+    "jsx": "preserve",
+    "paths": {
+      "@/*": [
+        "./src/*",
+        "./src/*.vue",
+        "./src/*/index.vue",
+        "./src/*/index.js"
+      ]
+    },
+    "lib": ["ESNext", "DOM"],
+    "skipLibCheck": true,
     "types": [
       "uni-app",
       "html5plus",
       "miniprogram-api-typings/types/lib.wx.api.d.ts",
       "mini-types/types/api"
     ]
+  },
+  "include": [
+    "src/**/*.js",
+    "src/**/*.ts",
+    "src/**/*.d.ts",
+    "src/**/*.vue"
+  ],
+  "exclude": [
+    "node_modules",
+    "dist",
+    "unpackage"
+  ],
+  "vueCompilerOptions": {
+    "target": 2.7
   }
 }