Kaynağa Gözat

修改拼团订单删除

邪性 3 yıl önce
ebeveyn
işleme
b40c501c4c

+ 2 - 1
dome/pages.json

@@ -31,7 +31,8 @@
 			"path": "pages/order/index",
 			"style": {
 				"usingComponents": {
-					"van-empty": "/wxcomponents/vant/dist/empty/index"
+					"van-empty": "/wxcomponents/vant/dist/empty/index",
+					"van-dialog": "/wxcomponents/vant/dist/dialog/index"
 				}
 			}
 		},

+ 22 - 6
dome/pages/order/index.vue

@@ -31,10 +31,14 @@
 				<view v-else :class="!item.no_more && item.pageCount <= item.totalPage ? 'cu-load bg-grey loading margin-top' : 'cu-load bg-grey over margin-top'"></view>
 			</view>
 		</view>
+		<!-- footer -->
+		<!-- 微信快捷登录 -->
+		<van-dialog id="van-dialog" />
 	</view>
 </template>
 
 <script>
+import Dialog from '@/wxcomponents/vant/dist/dialog/dialog';
 export default {
 	data() {
 		return {
@@ -103,24 +107,24 @@ export default {
 			}
 		},
 		// 支付签名
-		signature(data,index) {
+		signature(data, index) {
 			uni.requestPayment({
 				timeStamp: data.timeStamp,
 				nonceStr: data.nonceStr,
 				package: data.package,
 				signType: data.signType,
 				paySign: data.paySign,
-				success() {
+				success: () => {
 					var value = JSON.parse(JSON.stringify(this.value));
-					var no_a= value[this.active].value.splice(index, 1);
-					value[1].value.unshift(no_a);
+					var no_a = value[this.active].value.splice(index, 1);
+					value[1].value.unshift(no_a[0]);
 					this.value = value;
 					uni.showToast({
 						icon: 'none',
 						title: '支付成功'
 					});
 				},
-				fail() {
+				fail: () => {
 					uni.showToast({
 						icon: 'none',
 						title: '支付失败'
@@ -129,7 +133,19 @@ export default {
 			});
 		},
 		// 删除
-		async onClick(id, index) {
+		 onClick(id, index) {
+			Dialog.confirm({
+			  title: '提示',
+			  message: '确定要删除该订单?',
+			})
+			  .then(() => {
+				  this.deleteIndex(id,index)
+			  })
+			  .catch(() => {
+			    // on cancel
+			  });
+		},
+		async deleteIndex(id, index) {
 			try {
 				var res = await this.$global.request({
 					url: `/customer/order/${id}/del_order/ `,

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dome/unpackage/dist/dev/.sourcemap/mp-weixin/pages/order/index.js.map


+ 74 - 58
dome/unpackage/dist/dev/mp-weixin/pages/order/index.js

@@ -154,43 +154,47 @@ __webpack_require__.r(__webpack_exports__);
 /***/ (function(module, exports, __webpack_require__) {
 
 "use strict";
-/* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 21));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};} //
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-var _default =
+/* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 21));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+var _dialog = _interopRequireDefault(__webpack_require__(/*! @/wxcomponents/vant/dist/dialog/dialog */ 24));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}var _default =
 {
   data: function data() {
     return {
@@ -259,7 +263,7 @@ var _default =
 
     },
     // 支付签名
-    signature: function signature(data, index) {
+    signature: function signature(data, index) {var _this2 = this;
       uni.requestPayment({
         timeStamp: data.timeStamp,
         nonceStr: data.nonceStr,
@@ -267,10 +271,10 @@ var _default =
         signType: data.signType,
         paySign: data.paySign,
         success: function success() {
-          var value = JSON.parse(JSON.stringify(this.value));
-          var no_a = value[this.active].value.splice(index, 1);
-          value[1].value.unshift(no_a);
-          this.value = value;
+          var value = JSON.parse(JSON.stringify(_this2.value));
+          var no_a = value[_this2.active].value.splice(index, 1);
+          value[1].value.unshift(no_a[0]);
+          _this2.value = value;
           uni.showToast({
             icon: 'none',
             title: '支付成功' });
@@ -285,9 +289,21 @@ var _default =
 
     },
     // 删除
-    onClick: function onClick(id, index) {var _this2 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2() {var res, value;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:_context2.prev = 0;_context2.next = 3;return (
+    onClick: function onClick(id, index) {var _this3 = this;
+      _dialog.default.confirm({
+        title: '提示',
+        message: '确定要删除该订单?' }).
+
+      then(function () {
+        _this3.deleteIndex(id, index);
+      }).
+      catch(function () {
+        // on cancel
+      });
+    },
+    deleteIndex: function deleteIndex(id, index) {var _this4 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2() {var res, value;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:_context2.prev = 0;_context2.next = 3;return (
 
-                  _this2.$global.request({
+                  _this4.$global.request({
                     url: "/customer/order/".concat(id, "/del_order/ "),
                     method: 'post',
                     header: {
@@ -295,15 +311,15 @@ var _default =
                       Authorization: uni.getStorageSync('token') },
 
                     data: {
-                      appid: _this2.$store.state.userInfo.appid,
-                      activity_id: _this2.$store.state.userInfo.activity_id } }));case 3:res = _context2.sent;
+                      appid: _this4.$store.state.userInfo.appid,
+                      activity_id: _this4.$store.state.userInfo.activity_id } }));case 3:res = _context2.sent;
 
 
-                value = JSON.parse(JSON.stringify(_this2.value));
-                value[_this2.active].value.splice(index, 1);
-                _this2.value = value;_context2.next = 12;break;case 9:_context2.prev = 9;_context2.t0 = _context2["catch"](0);
+                value = JSON.parse(JSON.stringify(_this4.value));
+                value[_this4.active].value.splice(index, 1);
+                _this4.value = value;_context2.next = 12;break;case 9:_context2.prev = 9;_context2.t0 = _context2["catch"](0);
 
-                _this2.showErr(_context2.t0);case 12:case "end":return _context2.stop();}}}, _callee2, null, [[0, 9]]);}))();
+                _this4.showErr(_context2.t0);case 12:case "end":return _context2.stop();}}}, _callee2, null, [[0, 9]]);}))();
 
     },
     // 不同状态
@@ -312,11 +328,11 @@ var _default =
       this.request();
     },
     // 请求
-    request: function request() {var _this3 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3() {var $value, _$value$_this3$active, name, pageCount, no_more, totalPage, value, id, res;return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:
-                $value = JSON.parse(JSON.stringify(_this3.value));_$value$_this3$active =
-                $value[_this3.active], name = _$value$_this3$active.name, pageCount = _$value$_this3$active.pageCount, no_more = _$value$_this3$active.no_more, totalPage = _$value$_this3$active.totalPage, value = _$value$_this3$active.value, id = _$value$_this3$active.id;if (!(
+    request: function request() {var _this5 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3() {var $value, _$value$_this5$active, name, pageCount, no_more, totalPage, value, id, res;return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:
+                $value = JSON.parse(JSON.stringify(_this5.value));_$value$_this5$active =
+                $value[_this5.active], name = _$value$_this5$active.name, pageCount = _$value$_this5$active.pageCount, no_more = _$value$_this5$active.no_more, totalPage = _$value$_this5$active.totalPage, value = _$value$_this5$active.value, id = _$value$_this5$active.id;if (!(
                 pageCount > totalPage)) {_context3.next = 4;break;}return _context3.abrupt("return", false);case 4:_context3.next = 6;return (
-                  _this3.$global.request({
+                  _this5.$global.request({
                     url: '/customer/order/',
                     header: {
                       'Content-Type': 'application/x-www-form-urlencoded',
@@ -327,16 +343,16 @@ var _default =
                       page: pageCount,
                       limit: 20,
                       order_status: id,
-                      appid: _this3.$store.state.userInfo.appid,
-                      activity_id: _this3.$store.state.userInfo.activity_id } }));case 6:res = _context3.sent;
+                      appid: _this5.$store.state.userInfo.appid,
+                      activity_id: _this5.$store.state.userInfo.activity_id } }));case 6:res = _context3.sent;
 
 
                 pageCount++;
                 totalPage = res.totalPage;
                 if (pageCount > totalPage) no_more = true;
                 value = value.concat(res.data);
-                $value[_this3.active] = { name: name, pageCount: pageCount, no_more: no_more, totalPage: totalPage, value: value, id: id };
-                _this3.value = $value;case 13:case "end":return _context3.stop();}}}, _callee3);}))();
+                $value[_this5.active] = { name: name, pageCount: pageCount, no_more: no_more, totalPage: totalPage, value: value, id: id };
+                _this5.value = $value;case 13:case "end":return _context3.stop();}}}, _callee3);}))();
     } } };exports.default = _default;
 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
 

+ 2 - 1
dome/unpackage/dist/dev/mp-weixin/pages/order/index.json

@@ -2,6 +2,7 @@
   "usingComponents": {
     "cu-custom": "/colorui/components/cu-custom",
     "cu-nav": "/colorui/components/cu-nav",
-    "van-empty": "/wxcomponents/vant/dist/empty/index"
+    "van-empty": "/wxcomponents/vant/dist/empty/index",
+    "van-dialog": "/wxcomponents/vant/dist/dialog/index"
   }
 }

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dome/unpackage/dist/dev/mp-weixin/pages/order/index.wxml


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor