暂时去掉登录时候client参数,会引发account唯一索引错误

This commit is contained in:
2025-05-13 14:44:56 +08:00
parent a079f9d9fe
commit 1b6971407d
34 changed files with 1980 additions and 207 deletions

View File

@ -100,26 +100,26 @@ __webpack_require__.r(__webpack_exports__);
var components
try {
components = {
uImage: function () {
return __webpack_require__.e(/*! import() | components/uview-ui/components/u-image/u-image */ "components/uview-ui/components/u-image/u-image").then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-image/u-image.vue */ 375))
},
priceFormat: function () {
return __webpack_require__.e(/*! import() | components/price-format/price-format */ "components/price-format/price-format").then(__webpack_require__.bind(null, /*! @/components/price-format/price-format.vue */ 394))
},
uIcon: function () {
return __webpack_require__.e(/*! import() | components/uview-ui/components/u-icon/u-icon */ "components/uview-ui/components/u-icon/u-icon").then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-icon/u-icon.vue */ 354))
},
orderGoods: function () {
return __webpack_require__.e(/*! import() | components/order-goods/order-goods */ "components/order-goods/order-goods").then(__webpack_require__.bind(null, /*! @/components/order-goods/order-goods.vue */ 751))
},
uRadioGroup: function () {
return Promise.all(/*! import() | components/uview-ui/components/u-radio-group/u-radio-group */[__webpack_require__.e("common/vendor"), __webpack_require__.e("components/uview-ui/components/u-radio-group/u-radio-group")]).then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-radio-group/u-radio-group.vue */ 539))
},
uRadio: function () {
return __webpack_require__.e(/*! import() | components/uview-ui/components/u-radio/u-radio */ "components/uview-ui/components/u-radio/u-radio").then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-radio/u-radio.vue */ 546))
},
priceFormat: function () {
return __webpack_require__.e(/*! import() | components/price-format/price-format */ "components/price-format/price-format").then(__webpack_require__.bind(null, /*! @/components/price-format/price-format.vue */ 394))
},
uButton: function () {
return __webpack_require__.e(/*! import() | components/uview-ui/components/u-button/u-button */ "components/uview-ui/components/u-button/u-button").then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-button/u-button.vue */ 361))
},
appointmentTime: function () {
return Promise.all(/*! import() | components/appointment-time/appointment-time */[__webpack_require__.e("common/vendor"), __webpack_require__.e("components/appointment-time/appointment-time")]).then(__webpack_require__.bind(null, /*! @/components/appointment-time/appointment-time.vue */ 553))
return __webpack_require__.e(/*! import() | components/appointment-time/appointment-time */ "components/appointment-time/appointment-time").then(__webpack_require__.bind(null, /*! @/components/appointment-time/appointment-time.vue */ 553))
},
}
} catch (e) {
@ -143,11 +143,22 @@ var render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
var a0 = {
need: _vm.orderInfo.team_need,
}
if (!_vm._isMounted) {
_vm.e0 = function ($event) {
_vm.timePopup = false
}
}
_vm.$mp.data = Object.assign(
{},
{
$root: {
a0: a0,
},
}
)
}
var recyclableRender = false
var staticRenderFns = []
@ -183,10 +194,98 @@ __webpack_require__.r(__webpack_exports__);
"use strict";
/* WEBPACK VAR INJECTION */(function(uni) {
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 30));
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 32));
var _order = __webpack_require__(/*! @/api/order */ 750);
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
@ -293,30 +392,220 @@ var _default = {
weixin: 0,
alipay: 0
},
showLoading: false // Loading: 显示 | 隐藏
showLoading: false,
// Loading: 显示 | 隐藏
goods: {},
// 商品信息
// 地址Tabs列表
addressTabsList: [{
id: 1,
sign: 'express',
name: '快递配送'
}, {
id: 2,
sign: 'store',
name: '门店自提'
}],
addressTabsIndex: 0,
// 地址Tabs索引
goodsLists: [],
// 商品列表
orderInfo: {},
// 订单信息
address: {},
// 收货地址信息
addressId: '',
// 收货地址ID
storeInfo: {} // 门店信息
};
},
onLoad: function onLoad(options) {
console.log("this.$>>>", this.$store.state.goods.buyGoods);
var _this = this;
var data = JSON.parse(decodeURIComponent(options.data));
console.log("data>>>", data);
this.goods = data.goods;
this.pay.weixin = 1;
// 配送方式
(0, _order.getDelivery)().then(function (_ref) {
var code = _ref.code,
data = _ref.data,
msg = _ref.msg;
// 请求结果判断
if (code != 1) throw new Error(msg);
return data;
}).then(function (data) {
// 快递
if (!data.is_express) {
_this.addressTabsList = _this.addressTabsList.filter(function (item) {
return item.sign !== 'express';
});
}
// 自提
if (!data.is_selffetch) {
_this.addressTabsList = _this.addressTabsList.filter(function (item) {
return item.sign !== 'store';
});
}
})
// 页面数据初始化
.then(function () {
_this.handleOrderMethods('info');
_this.initCouponData();
})
// 监听全局事件
.then(function () {
uni.$on('selectaddress', function (params) {
_this.addressId = params.id;
_this.handleOrderMethods('info');
});
uni.$on('payment', function (params) {
setTimeout(function () {
uni.$off('payment');
if (params.result) {
uni.redirectTo({
url: "/pages/pay_result/pay_result?id=".concat(params.order_id)
});
} else {
uni.redirectTo({
url: '/pages/user_order/user_order'
});
}
}, 500);
});
uni.$on('store', function (params) {
_this.storeInfo = params;
});
}).catch(function (err) {
console.log(err);
});
},
onUnload: function onUnload() {
// 取消全局监听
uni.$off(['selectaddress', 'store']);
},
methods: {
appointmentTime: function appointmentTime() {
this.timePopup = true;
},
// 初始化优惠券数据
initCouponData: function initCouponData() {
var _this2 = this;
(0, _order.getOrderCoupon)({
goods: this.goods
}).then(function (_ref2) {
var code = _ref2.code,
data = _ref2.data,
msg = _ref2.msg;
if (code != 1) throw new Error(msg);
return data;
}).then(function (data) {
_this2.usableCoupon = data.usable;
_this2.unusableCoupon = data.unusable;
}).catch(function (err) {
console.log(err);
});
},
// 点击订单提交
onSubmitOrder: function onSubmitOrder() {
var _this = this;
var _this3 = this;
uni.showModal({
title: '温馨提示',
content: '是否确认下单?',
confirmColor: '#FF2C3C',
success: function success(_ref) {
var confirm = _ref.confirm;
success: function success(_ref3) {
var confirm = _ref3.confirm;
if (!confirm) return;
_this.handleOrderMethods('submit');
_this3.handleOrderMethods('submit');
}
});
},
// 订单处理
handleOrderMethods: function handleOrderMethods(action) {
// 订单提交数据
var orderFrom = {
action: action,
goods: this.goods,
delivery_type: this.delivery,
use_integral: this.useIntegral,
address_id: this.addressId,
coupon_id: this.couponId,
bargain_launch_id: this.bargainLaunchId == -1 ? '' : this.bargainLaunchId
};
switch (action) {
case 'info':
this.initPageData(orderFrom);
break;
case 'submit':
this.handleOrderSubmit(orderFrom);
break;
}
},
// 初始化页面数据
initPageData: function initPageData(from) {
var _this4 = this;
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
var _yield$orderBuy, code, data, msg;
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_this4.showLoading = true;
_context.prev = 1;
_context.next = 4;
return (0, _order.orderBuy)(from);
case 4:
_yield$orderBuy = _context.sent;
code = _yield$orderBuy.code;
data = _yield$orderBuy.data;
msg = _yield$orderBuy.msg;
if (!(code == 1)) {
_context.next = 16;
break;
}
_this4.address = data.address;
_this4.goodsLists = data.goods_lists;
//TODO
if (data.selffetch_info) {
_this4.storeInfo = data.selffetch_info.selffetch_shop ? data.selffetch_info.selffetch_shop : {};
_this4.userConsignee = data.selffetch_info.contact;
_this4.userMobile = data.selffetch_info.mobile;
}
_this4.orderInfo = data;
_this4.$nextTick(function () {
_this4.isFirstLoading = false;
});
_context.next = 17;
break;
case 16:
throw new Error(msg);
case 17:
_context.next = 23;
break;
case 19:
_context.prev = 19;
_context.t0 = _context["catch"](1);
console.log(_context.t0);
_this4.$toast({
title: '网络异常,请重新进入页面'
});
case 23:
_context.prev = 23;
_this4.showLoading = false;
return _context.finish(23);
case 26:
case "end":
return _context.stop();
}
}
}, _callee, null, [[1, 19, 23, 26]]);
}))();
},
// 点击选择收货地址
onAddressExpress: function onAddressExpress() {
uni.navigateTo({
url: "/bundle/pages/address/address?type=".concat(1)
});
} // 订单处理
// handleOrderMethods(action) {
// // 订单提交数据
@ -359,6 +648,11 @@ var _default = {
// this.showLoading = false
// }
// },
},
computed: {
delivery: function delivery() {
return this.addressTabsList[this.addressTabsIndex]['id'];
}
}
};
exports.default = _default;

View File

@ -1,11 +1,11 @@
{
"navigationBarTitleText": "确认订单",
"usingComponents": {
"u-image": "/components/uview-ui/components/u-image/u-image",
"price-format": "/components/price-format/price-format",
"u-icon": "/components/uview-ui/components/u-icon/u-icon",
"order-goods": "/components/order-goods/order-goods",
"u-radio-group": "/components/uview-ui/components/u-radio-group/u-radio-group",
"u-radio": "/components/uview-ui/components/u-radio/u-radio",
"price-format": "/components/price-format/price-format",
"u-button": "/components/uview-ui/components/u-button/u-button",
"appointment-time": "/components/appointment-time/appointment-time"
}

View File

@ -1 +1 @@
<view class="px32"><view class="bg-white br16 p24 row u-m-t-32"><view><u-image vue-id="eeabff18-1" src="{{cloudPath+'img/banner.png'}}" width="260" height="172" bind:__l="__l"></u-image></view><view class="ml20 flex1"><view class="nr bold-600">煎饼果子</view><view class="text-999 mt10">周一指周日可用</view><view class="mt20 row-between"><view class="row"><view class="primary"><price-format vue-id="eeabff18-2" price="{{12.9}}" subscriptSize="{{22}}" firstSize="{{40}}" secondSize="{{32}}" bind:__l="__l"></price-format></view><view class="u-m-l-8"><price-format vue-id="eeabff18-3" lineThrough="{{true}}" color="#C0C0C0" subscriptSize="{{22}}" firstSize="{{24}}" secondSize="{{24}}" price="{{16.9}}" bind:__l="__l"></price-format></view></view><view class="num nr">X1</view></view></view></view><view class="bg-white br16 p24 u-m-t-32"><view>备注</view><view class="flex1 u-m-t-16 mask">xxxx</view></view><view data-event-opts="{{[['tap',[['appointmentTime',['$event']]]]]}}" class="bg-white br16 p24 u-m-t-32 nr row-between" bindtap="__e"><view>预约时间</view><view class="row"><view class="u-m-r-10">16:00-16:30</view><u-icon vue-id="eeabff18-4" name="arrow-right" size="32" bind:__l="__l"></u-icon></view></view><view class="bg-white br16 p24 u-m-t-32 nr"><view class="row-between"><view class="row-center"><u-icon vue-id="eeabff18-5" name="weixin-circle-fill" color="#28C445" size="80" bind:__l="__l"></u-icon><view class="u-m-l-16 lg">微信</view></view><view class="flex1 row-end"><u-radio-group bind:input="__e" vue-id="eeabff18-6" value="{{pay.weixin}}" data-event-opts="{{[['^input',[['__set_model',['$0','weixin','$event',[]],['pay']]]]]}}" bind:__l="__l" vue-slots="{{['default']}}"><u-radio vue-id="{{('eeabff18-7')+','+('eeabff18-6')}}" shape="circle" active-color="{{themeColor}}" bind:__l="__l"></u-radio></u-radio-group></view></view></view><view class="fixed bg-white row-between px48 u-padding-top-20 u-padding-bottom-20"><view class="column u-text-center"><view class="row-center"><view class="count">共1件</view><view class="u-m-l-8">合计:</view><view class="primary" style="margin-top:-8rpx;"><price-format vue-id="eeabff18-8" price="{{12.9}}" subscriptSize="{{34}}" firstSize="{{56}}" secondSize="{{34}}" bind:__l="__l"></price-format></view></view></view><view class="u-m-l-64 flex1"><u-button vue-id="eeabff18-9" hover-class="none" customStyle="{{({height:'92rpx',backgroundColor:themeColor,color:'#fff',border:'none',paddingTop:'8rpx'})}}" hair-line="{{false}}" shape="circle" data-event-opts="{{[['^click',[['onSubmitOrder']]]]}}" bind:click="__e" bind:__l="__l" vue-slots="{{['default']}}">去支付</u-button></view></view><appointment-time bind:close="__e" bind:update="__e" bind:input="__e" vue-id="eeabff18-10" value="{{timePopup}}" data-event-opts="{{[['^close',[['e0']]],['^update',[['handleSubmitMobile']]],['^input',[['__set_model',['','timePopup','$event',[]]]]]]}}" bind:__l="__l"></appointment-time></view>
<view class="px32"><view class="bg-white br16 row u-m-t-32"><view data-event-opts="{{[['tap',[['onAddressExpress',['$event']]]]]}}" hidden="{{!(addressTabsList[addressTabsIndex]['sign']==='express')}}" class="u-flex p24 w-full" bindtap="__e"><view><u-icon class="right-icon" vue-id="eeabff18-1" name="map" size="48" bind:__l="__l"></u-icon></view><view class="u-flex flex1 u-row-between"><view class="ml10"><block wx:if="{{address.id}}"><view class="md black bold"><text>{{address.contact}}</text><text class="ml10">{{address.telephone}}</text></view><view class="xs black mt10">{{address.province+address.city+address.district+address.address}}</view></block><block wx:else><view>请选择收货地址</view></block></view><view><u-icon class="ml10" vue-id="eeabff18-2" name="arrow-right" bind:__l="__l"></u-icon></view></view></view></view><view class="bg-white br16 row u-m-t-32"><order-goods vue-id="eeabff18-3" team="{{$root.a0}}" list="{{goodsLists}}" delivery="{{delivery}}" order_type="{{orderInfo.order_type}}" imageWidth="{{260}}" imageHeight="{{172}}" mode="comfirm" bind:__l="__l"></order-goods></view><view class="bg-white br16 p24 u-m-t-32"><view>备注</view><view class="flex1 u-m-t-16 mask">xxxx</view></view><view data-event-opts="{{[['tap',[['appointmentTime',['$event']]]]]}}" class="bg-white br16 p24 u-m-t-32 nr row-between" bindtap="__e"><view>预约时间</view><view class="row"><view class="u-m-r-10">16:00-16:30</view><u-icon vue-id="eeabff18-4" name="arrow-right" size="32" bind:__l="__l"></u-icon></view></view><view class="bg-white br16 p24 u-m-t-32 nr"><view class="row-between"><view class="row-center"><u-icon vue-id="eeabff18-5" name="weixin-circle-fill" color="#28C445" size="80" bind:__l="__l"></u-icon><view class="u-m-l-16 lg">微信</view></view><view class="flex1 row-end"><u-radio-group bind:input="__e" vue-id="eeabff18-6" value="{{pay.weixin}}" data-event-opts="{{[['^input',[['__set_model',['$0','weixin','$event',[]],['pay']]]]]}}" bind:__l="__l" vue-slots="{{['default']}}"><u-radio vue-id="{{('eeabff18-7')+','+('eeabff18-6')}}" shape="circle" active-color="{{themeColor}}" bind:__l="__l"></u-radio></u-radio-group></view></view></view><view class="fixed bg-white row-between px48 u-padding-top-20 u-padding-bottom-20"><view class="column u-text-center"><view class="row-center"><view class="count">共1件</view><view class="u-m-l-8">合计:</view><view class="primary" style="margin-top:-8rpx;"><price-format vue-id="eeabff18-8" price="{{12.9}}" subscriptSize="{{34}}" firstSize="{{56}}" secondSize="{{34}}" bind:__l="__l"></price-format></view></view></view><view class="u-m-l-64 flex1"><u-button vue-id="eeabff18-9" hover-class="none" customStyle="{{({height:'92rpx',backgroundColor:themeColor,color:'#fff',border:'none',paddingTop:'8rpx'})}}" hair-line="{{false}}" shape="circle" data-event-opts="{{[['^click',[['onSubmitOrder']]]]}}" bind:click="__e" bind:__l="__l" vue-slots="{{['default']}}">去支付</u-button></view></view><appointment-time bind:close="__e" bind:update="__e" bind:input="__e" vue-id="eeabff18-10" value="{{timePopup}}" data-event-opts="{{[['^close',[['e0']]],['^update',[['handleSubmitMobile']]],['^input',[['__set_model',['','timePopup','$event',[]]]]]]}}" bind:__l="__l"></appointment-time></view>