完善功能
This commit is contained in:
@ -1 +1 @@
|
||||
<view class="content"><view class="store u-flex u-row-between u-p-32"><view><view data-event-opts="{{[['tap',[['chooseStore',['$event']]]]]}}" class="lg bold-600 u-flex" onTap="__e">MEET轻食店<u-icon class="right-icon" vue-id="8deb4120-1" name="arrow-right" size="28" onVueInit="__l"></u-icon></view><view class="u-m-t-8"><navigator class="u-flex" url hover-class="navigator-hover" open-type="navigate"><u-icon vue-id="8deb4120-2" name="map" size="32" onVueInit="__l"></u-icon>{{''+(userAddress||'请选择收货地址')+''}}</navigator></view></view><view><u-button vue-id="8deb4120-3" shape="circle" hair-line="{{false}}" hover-class="none" customStyle="{{({backgroundColor:themeColor,color:'#fff',border:'none',padding:'36rpx'})}}" data-event-opts="{{[['^click',[['signin']]]]}}" onClick="__e" onVueInit="__l" vue-slots="{{['default']}}">签到</u-button></view></view><view class="swiper u-relative"><u-swiper vue-id="8deb4120-4" height="524" list="{{list}}" border-radius="0" onVueInit="__l"></u-swiper><view class="balance bg-white u-flex"><view class="u-flex u-row-center"><u-image vue-id="8deb4120-5" src="{{cloudPath+'img/icon_balance.png'}}" width="52" height="52" onVueInit="__l"></u-image><view class="u-m-l-60 u-text-center"><view class="nr">{{userInfo.user_money||0.00}}</view><view class="text-default xs">余额</view></view></view><view class="u-flex u-row-center"><u-image vue-id="8deb4120-6" src="{{cloudPath+'img/icon_points.png'}}" width="52" height="52" onVueInit="__l"></u-image><view class="u-m-l-60 u-text-center"><view class="nr">{{userInfo.user_integral||0}}</view><view class="text-default xs">积分</view></view></view><view class="u-flex u-row-center"><u-image vue-id="8deb4120-7" src="{{cloudPath+'img/icon_coupon.png'}}" width="52" height="52" onVueInit="__l"></u-image><view class="u-m-l-60 u-text-center"><view class="nr">{{userInfo.coupon||0}}</view><view class="text-default xs u-text-center">券</view></view></view></view></view><view class="order u-flex u-row-between"><view data-event-opts="{{[['tap',[['buy',['$event']]]]]}}" class="bg-white u-text-center" onTap="__e"><view class="text-default xxl">预约下单</view><view class="xs text-999">极速送达更便捷</view><view class="u-flex u-row-center"><u-image vue-id="8deb4120-8" src="{{cloudPath+'img/icon_p_order.png'}}" width="132" height="132" onVueInit="__l"></u-image></view></view><view class="bg-white u-text-center"><view class="text-default xxl">现在点单</view><view class="xs text-999">下单更便捷</view><view class="u-flex u-row-center"><u-image vue-id="8deb4120-9" src="{{cloudPath+'img/icon_order.png'}}" width="132" height="133" mode="aspectFit" onVueInit="__l"></u-image></view></view></view><view class="mx20 u-m-b-64"><u-image vue-id="8deb4120-10" src="{{cloudPath+'img/activity.png'}}" height="264" onVueInit="__l"></u-image></view></view>
|
||||
<view class="content"><view class="store u-flex u-row-between u-p-32"><view class="flex1 u-line-1"><view class="lg bold-400 u-flex"><navigator class="u-flex" url="/pages/store/choose_store" hover-class="none">MEET轻食店<u-icon class="right-icon" vue-id="8deb4120-1" name="arrow-right" size="28" onVueInit="__l"></u-icon></navigator></view><view class="u-m-t-8 u-line-1"><navigator class="u-flex" url="/bundle/pages/address/address?type=1" hover-class="none"><u-icon vue-id="8deb4120-2" name="map" size="32" onVueInit="__l"></u-icon><view class="u-line-1">{{''+(userAddress||'请选择收货地址')+''}}</view></navigator></view></view><view><u-button vue-id="8deb4120-3" shape="circle" hair-line="{{false}}" hover-class="none" customStyle="{{({backgroundColor:themeColor,color:'#fff',border:'none',padding:'36rpx'})}}" data-event-opts="{{[['^click',[['signin']]]]}}" onClick="__e" onVueInit="__l" vue-slots="{{['default']}}">签到</u-button></view></view><view class="swiper u-relative"><u-swiper vue-id="8deb4120-4" height="524" list="{{adList}}" border-radius="0" onVueInit="__l"></u-swiper><view class="balance bg-white u-flex"><view><navigator class="u-flex u-row-center" url="/pages/my/wallet" hover-class="none"><u-image vue-id="8deb4120-5" src="{{cloudPath+'img/icon_balance.png'}}" width="52" height="52" onVueInit="__l"></u-image><view class="u-m-l-60 u-text-center"><view class="nr">{{userInfo.user_money||0.00}}</view><view class="text-default xs">余额</view></view></navigator></view><view><navigator class="u-flex u-row-center" url="/bundle/pages/points/points" hover-class="none"><u-image vue-id="8deb4120-6" src="{{cloudPath+'img/icon_points.png'}}" width="52" height="52" onVueInit="__l"></u-image><view class="u-m-l-60 u-text-center"><view class="nr">{{userInfo.user_integral||0}}</view><view class="text-default xs">积分</view></view></navigator></view><view><navigator class="u-flex u-row-center" url="/bundle/pages/coupon/coupon" hover-class="none"><u-image vue-id="8deb4120-7" src="{{cloudPath+'img/icon_coupon.png'}}" width="52" height="52" onVueInit="__l"></u-image><view class="u-m-l-60 u-text-center"><view class="nr">{{userInfo.coupon||0}}</view><view class="text-default xs u-text-center">券</view></view></navigator></view></view></view><view class="order u-flex u-row-between"><view class="bg-white u-text-center"><navigator url="/pages/store/store?type=1" hover-class="none"><view class="text-default xxl">预约下单</view><view class="xs text-999">极速送达更便捷</view><view class="u-flex u-row-center"><u-image vue-id="8deb4120-8" src="{{cloudPath+'img/icon_p_order.png'}}" width="132" height="132" onVueInit="__l"></u-image></view></navigator></view><view class="bg-white u-text-center"><navigator url="/pages/store/store?type=2" hover-class="none"><view class="text-default xxl">现在点单</view><view class="xs text-999">下单更便捷</view><view class="u-flex u-row-center"><u-image vue-id="8deb4120-9" src="{{cloudPath+'img/icon_order.png'}}" width="132" height="133" mode="aspectFit" onVueInit="__l"></u-image></view></navigator></view></view><view class="mx20 u-m-b-64"><u-image vue-id="8deb4120-10" src="{{cloudPath+'img/activity.png'}}" height="264" onVueInit="__l"></u-image></view></view>
|
||||
103
unpackage/dist/dev/mp-alipay/pages/index/index.js
vendored
103
unpackage/dist/dev/mp-alipay/pages/index/index.js
vendored
@ -101,16 +101,16 @@ var components
|
||||
try {
|
||||
components = {
|
||||
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 */ 310))
|
||||
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 */ 319))
|
||||
},
|
||||
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 */ 317))
|
||||
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 */ 326))
|
||||
},
|
||||
uSwiper: function () {
|
||||
return __webpack_require__.e(/*! import() | components/uview-ui/components/u-swiper/u-swiper */ "components/uview-ui/components/u-swiper/u-swiper").then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-swiper/u-swiper.vue */ 324))
|
||||
return __webpack_require__.e(/*! import() | components/uview-ui/components/u-swiper/u-swiper */ "components/uview-ui/components/u-swiper/u-swiper").then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-swiper/u-swiper.vue */ 333))
|
||||
},
|
||||
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 */ 331))
|
||||
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 */ 340))
|
||||
},
|
||||
}
|
||||
} catch (e) {
|
||||
@ -174,6 +174,8 @@ Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 26));
|
||||
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 28));
|
||||
var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 10));
|
||||
var _vuex = __webpack_require__(/*! vuex */ 29);
|
||||
var _app = __webpack_require__(/*! @/api/app */ 46);
|
||||
@ -185,48 +187,91 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
||||
var _default = {
|
||||
data: function data() {
|
||||
return {
|
||||
list: [{
|
||||
image: "http://jianbing-media.stnav.com/frontend/img/banner.png",
|
||||
title: "昨夜星辰昨夜风,画楼西畔桂堂东"
|
||||
}],
|
||||
userAddress: ''
|
||||
adList: [],
|
||||
userAddress: '',
|
||||
addressId: 0
|
||||
};
|
||||
},
|
||||
onLoad: function onLoad() {
|
||||
var _this = this;
|
||||
(0, _tools.setTabbar)();
|
||||
this.getUserAddress();
|
||||
|
||||
//更改收货地址
|
||||
uni.$on('selectaddress', function (params) {
|
||||
_this.addressId = params.id;
|
||||
_this.updateUserAddress();
|
||||
});
|
||||
this.getAdListFun();
|
||||
},
|
||||
onShow: function onShow() {
|
||||
this.getUser();
|
||||
this.getCartNum();
|
||||
},
|
||||
onUnload: function onUnload() {
|
||||
// 取消全局监听
|
||||
uni.$off(['selectaddress']);
|
||||
},
|
||||
methods: _objectSpread(_objectSpread({}, (0, _vuex.mapActions)(['getCartNum', 'getUser'])), {}, {
|
||||
// 获取广告轮播图
|
||||
getAdListFun: function getAdListFun() {
|
||||
var _this2 = this;
|
||||
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
||||
var _yield$getAdList, code, data;
|
||||
return _regenerator.default.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
_context.next = 2;
|
||||
return (0, _store.getAdList)({
|
||||
pid: 1,
|
||||
client: 1
|
||||
});
|
||||
case 2:
|
||||
_yield$getAdList = _context.sent;
|
||||
code = _yield$getAdList.code;
|
||||
data = _yield$getAdList.data;
|
||||
if (code) {
|
||||
_this2.adList = data;
|
||||
}
|
||||
case 6:
|
||||
case "end":
|
||||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee);
|
||||
}))();
|
||||
},
|
||||
// 获取默认物流地址
|
||||
getUserAddress: function getUserAddress() {
|
||||
var _this = this;
|
||||
var _this3 = this;
|
||||
(0, _user.getDefaultAddress)().then(function (res) {
|
||||
if (res.coed == 1) {
|
||||
var address = res.data.address;
|
||||
_this.userAddress = "".concat(province, " ").concat(city, " ").concat(district, " ").concat(address);
|
||||
if (res.code == 1) {
|
||||
var _res$data = res.data,
|
||||
id = _res$data.id,
|
||||
province = _res$data.province,
|
||||
city = _res$data.city,
|
||||
district = _res$data.district,
|
||||
address = _res$data.address;
|
||||
_this3.userAddress = "".concat(province, " ").concat(city, " ").concat(district, " ").concat(address);
|
||||
_this3.addressId = id;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 选择门店
|
||||
chooseStore: function chooseStore() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/store/choose_store'
|
||||
});
|
||||
},
|
||||
// 选择收货地址
|
||||
chooseAddress: function chooseAddress() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/store/choose_store'
|
||||
});
|
||||
},
|
||||
// 立即下单
|
||||
buy: function buy() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/store/store'
|
||||
// 用户切换物流地址
|
||||
updateUserAddress: function updateUserAddress() {
|
||||
var _this4 = this;
|
||||
(0, _user.getOneAddress)(this.addressId).then(function (res) {
|
||||
if (res.code == 1) {
|
||||
var _res$data2 = res.data,
|
||||
id = _res$data2.id,
|
||||
province = _res$data2.province,
|
||||
city = _res$data2.city,
|
||||
district = _res$data2.district,
|
||||
address = _res$data2.address;
|
||||
_this4.userAddress = "".concat(province, " ").concat(city, " ").concat(district, " ").concat(address);
|
||||
_this4.addressId = id;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 签到
|
||||
|
||||
Reference in New Issue
Block a user