暂时去掉登录时候client参数,会引发account唯一索引错误
This commit is contained in:
@ -261,8 +261,8 @@ var _default = {
|
||||
code: wxCode,
|
||||
nickname: nickName || '',
|
||||
//支付宝小程序没有直接获取昵称
|
||||
headimgurl: avatarUrl,
|
||||
client: _tools.client
|
||||
headimgurl: avatarUrl
|
||||
// client
|
||||
});
|
||||
case 16:
|
||||
_yield$authLogin = _context.sent;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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"
|
||||
}
|
||||
|
||||
@ -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>
|
||||
39
unpackage/dist/dev/mp-weixin/pages/shop/shop.js
vendored
39
unpackage/dist/dev/mp-weixin/pages/shop/shop.js
vendored
@ -279,7 +279,8 @@ var _default = {
|
||||
id: 0,
|
||||
showSpec: false,
|
||||
goods: [],
|
||||
spec: []
|
||||
spec: [],
|
||||
checkedGoods: {}
|
||||
};
|
||||
},
|
||||
onLoad: function onLoad(options) {
|
||||
@ -328,22 +329,30 @@ var _default = {
|
||||
this.spec = data.spec;
|
||||
this.showSpec = false;
|
||||
},
|
||||
// 购买商品
|
||||
onBuy: function onBuy() {
|
||||
// 这里需压判断选购规格
|
||||
onChangeGoods: function onChangeGoods(e) {
|
||||
console.log(e);
|
||||
this.checkedGoods = e.detail;
|
||||
},
|
||||
// 选择规格
|
||||
showSpecFun: function showSpecFun() {
|
||||
if (!this.isLogin) return (0, _login.toLogin)();
|
||||
this.$store.commit("setBuyGoods", {
|
||||
id: this.id,
|
||||
// 商品id
|
||||
num: 1,
|
||||
// 购买商品数量
|
||||
spec: this.spec // 选中的商品规格
|
||||
});
|
||||
|
||||
// console.log("this.$>>>", this.$store.state.goods.buyGoods);
|
||||
|
||||
this.showSpec = true;
|
||||
},
|
||||
// 购买商品
|
||||
onBuy: function onBuy(e) {
|
||||
var _e$detail = e.detail,
|
||||
id = _e$detail.id,
|
||||
goodsNum = _e$detail.goodsNum;
|
||||
var goods = [{
|
||||
item_id: id,
|
||||
num: goodsNum
|
||||
}];
|
||||
var params = {
|
||||
goods: goods
|
||||
};
|
||||
this.showSpec = false;
|
||||
uni.navigateTo({
|
||||
url: "/pages/order_now/order_now"
|
||||
url: '/pages/order_now/order_now?data=' + encodeURIComponent(JSON.stringify(params))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -1 +1 @@
|
||||
<view><view class="shop"><view><u-swiper vue-id="73adca00-1" list="{{goods.goods_image}}" name="uri" height="500" border-radius="0" mode="number" indicator-pos="bottomRight" bind:__l="__l"></u-swiper></view><view class="bg-white mx24 px24 u-m-t-24 u-padding-top-20 u-padding-bottom-20 br24"><view class="nr">{{goods.name}}</view><view class="mt10 row u-row-between"><view class="row"><view class="primary"><price-format vue-id="73adca00-2" price="{{goods.min_price}}" subscriptSize="{{22}}" firstSize="{{34}}" secondSize="{{26}}" bind:__l="__l"></price-format></view><view class="sale u-text-center primary u-m-l-12">0折</view><view class="primary u-m-l-12"><price-format vue-id="73adca00-3" lineThrough="{{true}}" color="#999" subscriptSize="{{22}}" firstSize="{{22}}" secondSize="{{22}}" price="{{goods.market_price}}" bind:__l="__l"></price-format></view></view><view class="text-999">已售66</view></view><view class="u-m-t-20 u-m-b-20"><u-line vue-id="73adca00-4" color="#eee" bind:__l="__l"></u-line></view><view><view><text>须知</text><text class="text-999 ml20">周一至周日可用</text></view><view class="row-between mt20"><view><text>保障</text><text class="text-999 ml20">随时退 过期自动退</text></view><view><u-button vue-id="73adca00-5" hover-class="none" customStyle="{{({width:'116rpx',height:'46rpx',lineHeight:'46rpx',fontSize:'24rpx',backgroundColor:themeColor,color:'#fff',border:'none',paddingTop:'8rpx'})}}" hair-line="{{false}}" shape="circle" data-event-opts="{{[['^click',[['openSpec']]]]}}" bind:click="__e" bind:__l="__l" vue-slots="{{['default']}}">选规格</u-button></view></view></view></view><view class="u-m-t-24"><view class="u-m-l-48 nr">详情</view><view class="bg-white mx24 px24 u-m-t-24 u-p-t-20 u-p-b-20 br24"><u-image vue-id="73adca00-6" src="{{cloudPath+'img/banner.png'}}" height="600" bind:__l="__l"></u-image></view></view><view class="u-m-t-24"><view class="u-m-l-48 nr">购买须知</view><view class="bg-white mx24 px24 u-m-t-24 u-p-t-20 u-p-b-20 br24">这里是购买须知的内容</view></view></view><view class="fixed bg-white row-between px48 u-p-t-20 u-p-b-20"><view class="column u-text-center"><view class="row-center"><u-image vue-id="73adca00-7" src="{{cloudPath+'img/icon_store.png'}}" width="48" height="48" bind:__l="__l"></u-image></view><view>门店</view></view><view class="u-m-l-64 flex1"><u-button vue-id="73adca00-8" hover-class="none" customStyle="{{({height:'92rpx',fontSize:'24rpx',backgroundColor:themeColor,color:'#fff',border:'none',paddingTop:'8rpx'})}}" hair-line="{{false}}" shape="circle" data-event-opts="{{[['^click',[['onBuy']]]]}}" bind:click="__e" bind:__l="__l" vue-slots="{{['default']}}">立即购买</u-button></view></view><shop-spec vue-id="73adca00-9" name="{{goods.name}}" spec="{{goods.goods_spec}}" value="{{showSpec}}" data-event-opts="{{[['^close',[['e0']]],['^confirm',[['confirmSpec']]],['^input',[['__set_model',['','showSpec','$event',[]]]]]]}}" bind:close="__e" bind:confirm="__e" bind:input="__e" bind:__l="__l"></shop-spec></view>
|
||||
<view><view class="shop"><view><u-swiper vue-id="73adca00-1" list="{{goods.goods_image}}" name="uri" height="500" border-radius="0" mode="number" indicator-pos="bottomRight" bind:__l="__l"></u-swiper></view><view class="bg-white mx24 px24 u-m-t-24 u-padding-top-20 u-padding-bottom-20 br24"><view class="nr">{{goods.name}}</view><view class="mt10 row u-row-between"><view class="row"><view class="primary"><price-format vue-id="73adca00-2" price="{{goods.min_price}}" subscriptSize="{{22}}" firstSize="{{34}}" secondSize="{{26}}" bind:__l="__l"></price-format></view><view class="sale u-text-center primary u-m-l-12">0折</view><view class="primary u-m-l-12"><price-format vue-id="73adca00-3" lineThrough="{{true}}" color="#999" subscriptSize="{{22}}" firstSize="{{22}}" secondSize="{{22}}" price="{{goods.market_price}}" bind:__l="__l"></price-format></view></view><view class="text-999">已售66</view></view><view class="u-m-t-20 u-m-b-20"><u-line vue-id="73adca00-4" color="#eee" bind:__l="__l"></u-line></view><view><view><text>须知</text><text class="text-999 ml20">周一至周日可用</text></view><view class="row-between mt20"><view><text>保障</text><text class="text-999 ml20">随时退 过期自动退</text></view><view><u-button vue-id="73adca00-5" hover-class="none" customStyle="{{({width:'116rpx',height:'46rpx',lineHeight:'46rpx',fontSize:'24rpx',backgroundColor:themeColor,color:'#fff',border:'none',paddingTop:'8rpx'})}}" hair-line="{{false}}" shape="circle" data-event-opts="{{[['^click',[['openSpec']]]]}}" bind:click="__e" bind:__l="__l" vue-slots="{{['default']}}">选规格</u-button></view></view></view></view><view class="u-m-t-24"><view class="u-m-l-48 nr">详情</view><view class="bg-white mx24 px24 u-m-t-24 u-p-t-20 u-p-b-20 br24"><u-image vue-id="73adca00-6" src="{{cloudPath+'img/banner.png'}}" height="600" bind:__l="__l"></u-image></view></view><view class="u-m-t-24"><view class="u-m-l-48 nr">购买须知</view><view class="bg-white mx24 px24 u-m-t-24 u-p-t-20 u-p-b-20 br24">这里是购买须知的内容</view></view></view><view class="fixed bg-white row-between px48 u-p-t-20 u-p-b-20"><view class="column u-text-center"><view class="row-center"><u-image vue-id="73adca00-7" src="{{cloudPath+'img/icon_store.png'}}" width="48" height="48" bind:__l="__l"></u-image></view><view>门店</view></view><view class="u-m-l-64 flex1"><u-button vue-id="73adca00-8" hover-class="none" customStyle="{{({height:'92rpx',fontSize:'24rpx',backgroundColor:themeColor,color:'#fff',border:'none',paddingTop:'8rpx'})}}" hair-line="{{false}}" shape="circle" data-event-opts="{{[['^click',[['showSpecFun']]]]}}" bind:click="__e" bind:__l="__l" vue-slots="{{['default']}}">立即购买</u-button></view></view><shop-spec vue-id="73adca00-9" name="{{goods.name}}" goods="{{goods}}" value="{{showSpec}}" data-event-opts="{{[['^close',[['e0']]],['^confirm',[['confirmSpec']]],['^buynow',[['onBuy']]],['^input',[['__set_model',['','showSpec','$event',[]]]]]]}}" bind:close="__e" bind:confirm="__e" bind:buynow="__e" bind:input="__e" bind:__l="__l"></shop-spec></view>
|
||||
@ -114,6 +114,11 @@ var _default = {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 选择单个商品
|
||||
changOneSelect: function changOneSelect(cartId, selected) {
|
||||
selected = !selected;
|
||||
this.changeCartSelectFun([cartId], selected);
|
||||
},
|
||||
// 更改全选状态
|
||||
changeAllSelect: function changeAllSelect() {
|
||||
var isSelectedAll = this.isSelectedAll,
|
||||
@ -147,17 +152,22 @@ var _default = {
|
||||
});
|
||||
}
|
||||
});
|
||||
console.log("this.cartList>>>", goods);
|
||||
if (goods.length == 0) return this.$toast({
|
||||
title: "您还没有选择商品哦"
|
||||
});
|
||||
uni.navigateTo({
|
||||
url: "/pages/confirm_order/confirm_order?data=" + encodeURIComponent(JSON.stringify({
|
||||
goods: goods,
|
||||
type: "cart"
|
||||
}))
|
||||
});
|
||||
// uni.navigateTo({
|
||||
// url: "/pages/confirm_order/confirm_order?data=" +
|
||||
// encodeURIComponent(
|
||||
// JSON.stringify({
|
||||
// goods,
|
||||
// type: "cart",
|
||||
// })
|
||||
// ),
|
||||
// });
|
||||
}
|
||||
}),
|
||||
|
||||
computed: _objectSpread(_objectSpread({}, (0, _vuex.mapGetters)(["cartNum"])), {}, {
|
||||
nullSelect: function nullSelect() {
|
||||
var index = this.cartLists.findIndex(function (item) {
|
||||
|
||||
@ -1 +1 @@
|
||||
<view class="shop-cart"><view class="u-m-32"><block wx:if="{{$root.g0>0}}"><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" class="u-text-right nr" bindtap="__e">{{!isEdit?'编辑':'完成'}}</view></block><block wx:for="{{cartLists}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="u-m-t-40"><view class="bg-white br16 u-p-24 row"><view class="select checkbox"><checkbox class="checkbox" type="circle" value="{{item.cart_id+''}}" checked="{{item.selected==1}}" data-event-opts="{{[['tap',[['changOneSelect',['$0','$1'],[[['cartLists','',index,'cart_id']],[['cartLists','',index,'selected']]]]]]]}}" bindtap="__e"></checkbox></view><view class="row flex1 u-col-top"><view><u-image vue-id="{{'9fac4ca8-1-'+index}}" src="{{item.img}}" width="160" height="160" border-radius="8" bind:__l="__l"></u-image></view><view class="u-m-l-16"><navigator url="{{'/pages/shop/shop?id='+item.goods_id}}" hover-class="none"><view class="u-line-2">{{item.name}}</view></navigator><view class="sm text-999 u-m-t-8 attr u-text-center u-p-l-16 u-p-r-16 u-p-6-8 u-p-b-8"><text>味浓芳香</text><text class="u-m-l-8 u-m-r-8">|</text><text>味浓芳香</text><text class="u-m-l-8 u-m-r-8">|</text><text>味浓芳香</text></view><view class="u-m-t-16 row-between"><view class="primary"><price-format vue-id="{{'9fac4ca8-2-'+index}}" price="{{item.price}}" subscriptSize="{{22}}" firstSize="{{34}}" secondSize="{{26}}" bind:__l="__l"></price-format></view><view><block wx:if="{{!isEdit}}"><view><u-number-box vue-id="{{'9fac4ca8-3-'+index}}" disabled="{{item.cart_status!=0}}" value="{{item.goods_num}}" min="{{1}}" max="{{item.item_stock}}" data-event-opts="{{[['^change',[['countChange',['$event','$0','$1'],[[['cartLists','',index,'cart_id']],[['cartLists','',index]]]]]]]}}" bind:change="__e" bind:__l="__l"></u-number-box></view></block><block wx:if="{{isEdit}}"><view data-event-opts="{{[['tap',[['deleteCartGoods',['$0'],[[['cartLists','',index,'cart_id']]]]]]]}}" catchtap="__e"><u-icon vue-id="{{'9fac4ca8-4-'+index}}" name="trash" size="32" color="#999" bind:__l="__l"></u-icon></view></block></view></view></view></view></view></view></block><block wx:if="{{!(cartType!=2)}}"><view hidden="{{!(!(cartType!=2))}}" class="cart-null column-center mb20" style="padding:80rpx 0 50rpx;"><image class="img-null" src="{{cloudPath+'img/cart_null.png'}}"></image><view class="muted mb20">购物车暂无任何商品~</view></view></block></view><block wx:if="{{!isLogin}}"><view class="login column-center u-m-t-80"><image class="img-null" src="{{cloudPath+'img/cart_null.png'}}" width="1200" height="1200" mode="aspectFill"></image><view class="muted mt20">登录后才能查看购物车哦</view><navigator class="mt20 br60 row-center btn text-default" url="/pages/login/login" hover-class="none"><text>去登录</text></navigator></view></block><block wx:if="{{!(cartType!=1)}}"><view class="fixed footer bg-white w-full row-between u-col-center px32"><view><checkbox-group data-event-opts="{{[['change',[['changeAllSelect',['$event']]]]]}}" class="row checkbox" bindchange="__e"><checkbox id="checkAll" value="all" checked="{{isSelectedAll}}"></checkbox><label class="ml10" for="checkAll">全选</label></checkbox-group></view><view class="row"><view class="row-center"><view>合计:</view><view class="primary u-m-l-8" style="margin-top:-8rpx;"><price-format vue-id="9fac4ca8-5" price="{{totalPrice}}" subscriptSize="{{32}}" firstSize="{{40}}" secondSize="{{32}}" bind:__l="__l"></price-format></view></view><view class="u-m-l-24"><u-button vue-id="9fac4ca8-6" hover-class="none" customStyle="{{({width:'228rpx',height:'80rpx',backgroundColor:themeColor,color:'#fff',border:'none',padding:'16rpx 0',borderRadius:'64rpx'})}}" hair-line="{{false}}" data-event-opts="{{[['^click',[['mpLogin']]]]}}" bind:click="__e" bind:__l="__l" vue-slots="{{['default']}}">结算</u-button></view></view></view></block></view>
|
||||
<view class="shop-cart"><view class="u-m-32"><block wx:if="{{$root.g0>0}}"><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" class="u-text-right nr" bindtap="__e">{{!isEdit?'编辑':'完成'}}</view></block><block wx:for="{{cartLists}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="u-m-t-40"><view class="bg-white br16 u-p-24 row"><view class="select checkbox"><checkbox class="checkbox" type="circle" value="{{item.cart_id+''}}" checked="{{item.selected==1}}" data-event-opts="{{[['tap',[['changOneSelect',['$0','$1'],[[['cartLists','',index,'cart_id']],[['cartLists','',index,'selected']]]]]]]}}" bindtap="__e"></checkbox></view><view class="row flex1 u-col-top"><view><u-image vue-id="{{'9fac4ca8-1-'+index}}" src="{{item.img}}" width="160" height="160" border-radius="8" bind:__l="__l"></u-image></view><view class="u-m-l-16"><navigator url="{{'/pages/shop/shop?id='+item.goods_id}}" hover-class="none"><view class="u-line-2">{{item.name}}</view></navigator><view class="sm text-999 u-m-t-8 attr u-text-center u-p-l-16 u-p-r-16 u-p-6-8 u-p-b-8"><text>味浓芳香</text><text class="u-m-l-8 u-m-r-8">|</text><text>味浓芳香</text><text class="u-m-l-8 u-m-r-8">|</text><text>味浓芳香</text></view><view class="u-m-t-16 row-between"><view class="primary"><price-format vue-id="{{'9fac4ca8-2-'+index}}" price="{{item.price}}" subscriptSize="{{22}}" firstSize="{{34}}" secondSize="{{26}}" bind:__l="__l"></price-format></view><view><block wx:if="{{!isEdit}}"><view><u-number-box vue-id="{{'9fac4ca8-3-'+index}}" disabled="{{item.cart_status!=0}}" value="{{item.goods_num}}" min="{{1}}" max="{{item.item_stock}}" data-event-opts="{{[['^change',[['countChange',['$event','$0','$1'],[[['cartLists','',index,'cart_id']],[['cartLists','',index]]]]]]]}}" bind:change="__e" bind:__l="__l"></u-number-box></view></block><block wx:if="{{isEdit}}"><view data-event-opts="{{[['tap',[['deleteCartGoods',['$0'],[[['cartLists','',index,'cart_id']]]]]]]}}" catchtap="__e"><u-icon vue-id="{{'9fac4ca8-4-'+index}}" name="trash" size="32" color="#999" bind:__l="__l"></u-icon></view></block></view></view></view></view></view></view></block><block wx:if="{{!(cartType!=2)}}"><view hidden="{{!(!(cartType!=2))}}" class="cart-null column-center mb20" style="padding:80rpx 0 50rpx;"><image class="img-null" src="{{cloudPath+'img/cart_null.png'}}"></image><view class="muted mb20">购物车暂无任何商品~</view></view></block></view><block wx:if="{{!isLogin}}"><view class="login column-center u-m-t-80"><image class="img-null" src="{{cloudPath+'img/cart_null.png'}}" width="1200" height="1200" mode="aspectFill"></image><view class="muted mt20">登录后才能查看购物车哦</view><navigator class="mt20 br60 row-center btn text-default" url="/pages/login/login" hover-class="none"><text>去登录</text></navigator></view></block><block wx:if="{{!(cartType!=1)}}"><view class="fixed footer bg-white w-full row-between u-col-center px32"><view><checkbox-group data-event-opts="{{[['change',[['changeAllSelect',['$event']]]]]}}" class="row checkbox" bindchange="__e"><checkbox id="checkAll" value="all" checked="{{isSelectedAll}}"></checkbox><label class="ml10" for="checkAll">全选</label></checkbox-group></view><view class="row"><view class="row-center"><view>合计:</view><view class="primary u-m-l-8" style="margin-top:-8rpx;"><price-format vue-id="9fac4ca8-5" price="{{totalPrice}}" subscriptSize="{{32}}" firstSize="{{40}}" secondSize="{{32}}" bind:__l="__l"></price-format></view></view><view class="u-m-l-24"><u-button vue-id="9fac4ca8-6" hover-class="none" customStyle="{{({width:'228rpx',height:'80rpx',backgroundColor:themeColor,color:'#fff',border:'none',padding:'16rpx 0',borderRadius:'64rpx'})}}" hair-line="{{false}}" data-event-opts="{{[['^click',[['goToConfirm']]]]}}" bind:click="__e" bind:__l="__l" vue-slots="{{['default']}}">结算</u-button></view></view></view></block></view>
|
||||
Reference in New Issue
Block a user