mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 17:38:48 +08:00
首页装修/收货地址增删改/设置默认
This commit is contained in:
parent
ebbdb4ac44
commit
e945b85dbb
@ -27,15 +27,18 @@ import com.ruoyi.winery.service.IAppUserAddressService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
import static com.ruoyi.common.utils.SecurityUtils.getDeptId;
|
||||
import static com.ruoyi.common.utils.SecurityUtils.getLoginUser;
|
||||
|
||||
/**
|
||||
* 用户收货地址Controller
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2021-01-16
|
||||
*/
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RestController
|
||||
@RequestMapping("/user/address" )
|
||||
@RequestMapping("/user/address")
|
||||
public class AppUserAddressController extends BaseController {
|
||||
|
||||
private final IAppUserAddressService iAppUserAddressService;
|
||||
@ -45,31 +48,40 @@ public class AppUserAddressController extends BaseController {
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('user:address:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AppUserAddress appUserAddress)
|
||||
{
|
||||
public TableDataInfo list(AppUserAddress appUserAddress) {
|
||||
startPage();
|
||||
LambdaQueryWrapper<AppUserAddress> lqw = Wrappers.lambdaQuery(appUserAddress);
|
||||
if (appUserAddress.getDeptId() != null){
|
||||
lqw.eq(AppUserAddress::getDeptId ,appUserAddress.getDeptId());
|
||||
if (appUserAddress.getDeptId() != null) {
|
||||
lqw.eq(AppUserAddress::getDeptId, appUserAddress.getDeptId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(appUserAddress.getUserId())){
|
||||
lqw.eq(AppUserAddress::getUserId ,appUserAddress.getUserId());
|
||||
if (appUserAddress.getUserId() != null) {
|
||||
lqw.eq(AppUserAddress::getUserId, appUserAddress.getUserId());
|
||||
}
|
||||
if (appUserAddress.getIsDefault() != null){
|
||||
lqw.eq(AppUserAddress::getIsDefault ,appUserAddress.getIsDefault());
|
||||
if (appUserAddress.getIsDefault() != null) {
|
||||
lqw.eq(AppUserAddress::getIsDefault, appUserAddress.getIsDefault());
|
||||
}
|
||||
if (StringUtils.isNotBlank(appUserAddress.getMobile())){
|
||||
lqw.eq(AppUserAddress::getMobile ,appUserAddress.getMobile());
|
||||
if (StringUtils.isNotBlank(appUserAddress.getMobile())) {
|
||||
lqw.eq(AppUserAddress::getMobile, appUserAddress.getMobile());
|
||||
}
|
||||
if (StringUtils.isNotBlank(appUserAddress.getName())){
|
||||
lqw.like(AppUserAddress::getName ,appUserAddress.getName());
|
||||
if (StringUtils.isNotBlank(appUserAddress.getName())) {
|
||||
lqw.like(AppUserAddress::getName, appUserAddress.getName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(appUserAddress.getAddress())){
|
||||
lqw.eq(AppUserAddress::getAddress ,appUserAddress.getAddress());
|
||||
if (StringUtils.isNotBlank(appUserAddress.getAddress())) {
|
||||
lqw.eq(AppUserAddress::getAddress, appUserAddress.getAddress());
|
||||
}
|
||||
if (StringUtils.isNotBlank(appUserAddress.getRegion())){
|
||||
lqw.eq(AppUserAddress::getRegion ,appUserAddress.getRegion());
|
||||
if (StringUtils.isNotBlank(appUserAddress.getRegion())) {
|
||||
lqw.eq(AppUserAddress::getRegion, appUserAddress.getRegion());
|
||||
}
|
||||
|
||||
|
||||
// 使小程序用户仅能查询自己的收货地址
|
||||
String userName = getLoginUser().getUser().getUserName();
|
||||
if (userName.contains("mini-")) {
|
||||
lqw.eq(AppUserAddress::getUserId, getLoginUser().getUser().getUserId());
|
||||
}
|
||||
|
||||
lqw.orderByDesc(AppUserAddress::getIsDefault);
|
||||
|
||||
List<AppUserAddress> list = iAppUserAddressService.list(lqw);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@ -77,51 +89,79 @@ public class AppUserAddressController extends BaseController {
|
||||
/**
|
||||
* 导出用户收货地址列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('user:address:export')" )
|
||||
@Log(title = "用户收货地址" , businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export" )
|
||||
@PreAuthorize("@ss.hasPermi('user:address:export')")
|
||||
@Log(title = "用户收货地址", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(AppUserAddress appUserAddress) {
|
||||
LambdaQueryWrapper<AppUserAddress> lqw = new LambdaQueryWrapper<AppUserAddress>(appUserAddress);
|
||||
List<AppUserAddress> list = iAppUserAddressService.list(lqw);
|
||||
ExcelUtil<AppUserAddress> util = new ExcelUtil<AppUserAddress>(AppUserAddress. class);
|
||||
return util.exportExcel(list, "address" );
|
||||
ExcelUtil<AppUserAddress> util = new ExcelUtil<AppUserAddress>(AppUserAddress.class);
|
||||
return util.exportExcel(list, "address");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户收货地址详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('user:address:query')" )
|
||||
@GetMapping(value = "/{id}" )
|
||||
public AjaxResult getInfo(@PathVariable("id" ) String id) {
|
||||
@PreAuthorize("@ss.hasPermi('user:address:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return AjaxResult.success(iAppUserAddressService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户收货地址
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('user:address:add')" )
|
||||
@Log(title = "用户收货地址" , businessType = BusinessType.INSERT)
|
||||
@PreAuthorize("@ss.hasPermi('user:address:add')")
|
||||
@Log(title = "用户收货地址", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AppUserAddress appUserAddress) {
|
||||
|
||||
Long userId = getLoginUser().getUser().getUserId();
|
||||
appUserAddress.setUserId(userId);
|
||||
appUserAddress.setDeptId(getDeptId());
|
||||
|
||||
// 首发设为默认收货地址
|
||||
if (appUserAddress.getIsDefault() == null) {
|
||||
List<AppUserAddress> list = iAppUserAddressService.list(
|
||||
new LambdaQueryWrapper<AppUserAddress>().eq(AppUserAddress::getUserId, userId)
|
||||
);
|
||||
appUserAddress.setIsDefault(list.size() > 0 ? 0 : 1);
|
||||
}
|
||||
|
||||
|
||||
return toAjax(iAppUserAddressService.save(appUserAddress) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户收货地址
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('user:address:edit')" )
|
||||
@Log(title = "用户收货地址" , businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermi('user:address:edit')")
|
||||
@Log(title = "用户收货地址", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AppUserAddress appUserAddress) {
|
||||
|
||||
if (appUserAddress.getIsDefault() == 1) {
|
||||
|
||||
AppUserAddress updateItem = new AppUserAddress();
|
||||
updateItem.setIsDefault(0);
|
||||
|
||||
iAppUserAddressService.update(updateItem ,new LambdaQueryWrapper<AppUserAddress>()
|
||||
.eq(AppUserAddress::getUserId, appUserAddress.getUserId())
|
||||
.eq(AppUserAddress::getIsDefault, 1)
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
return toAjax(iAppUserAddressService.updateById(appUserAddress) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户收货地址
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('user:address:remove')" )
|
||||
@Log(title = "用户收货地址" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}" )
|
||||
@PreAuthorize("@ss.hasPermi('user:address:remove')")
|
||||
@Log(title = "用户收货地址", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
return toAjax(iAppUserAddressService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ private static final long serialVersionUID=1L;
|
||||
|
||||
|
||||
/** ID */
|
||||
@TableId(value = "id")
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/** 部门ID */
|
||||
@ -42,7 +42,7 @@ private static final long serialVersionUID=1L;
|
||||
|
||||
/** 用户ID */
|
||||
@Excel(name = "用户ID")
|
||||
private String userId;
|
||||
private Long userId;
|
||||
|
||||
/** 是否默认 */
|
||||
@Excel(name = "是否默认")
|
||||
|
||||
@ -116,10 +116,17 @@
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"name": "地址管理",
|
||||
"name": "新增地址",
|
||||
"pathName": "pages/mall/user/user-address",
|
||||
"query": "",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"name": "地址管理",
|
||||
"pathName": "pages/mall/user/user-address-list",
|
||||
"query": "",
|
||||
"scene": null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
52
mini-app/src/apis/addressApis.js
Normal file
52
mini-app/src/apis/addressApis.js
Normal file
@ -0,0 +1,52 @@
|
||||
import request from '../js/request'
|
||||
import { baseUrl } from '../baseDefine'
|
||||
import { jsonHeader } from './xiao4rApis'
|
||||
|
||||
/**
|
||||
* 地址管理相关接口
|
||||
*/
|
||||
class AddressApis {
|
||||
/**
|
||||
* 创建地址
|
||||
* @param data
|
||||
* @returns {Promise实例对象}
|
||||
*/
|
||||
getAddressList(data) {
|
||||
return request.get({
|
||||
url: baseUrl + 'user/address/list',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
getAddressById(id) {
|
||||
return request.get({
|
||||
url: baseUrl + 'user/address/' + id
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
createAddress(data) {
|
||||
|
||||
return request.post({
|
||||
url: baseUrl + 'user/address',
|
||||
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
delAddress(data) {
|
||||
return request.del({
|
||||
url: baseUrl + 'user/address',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
editAddress(data) {
|
||||
return request.put({
|
||||
url: baseUrl + 'user/address',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default new AddressApis()
|
||||
@ -1,7 +1,6 @@
|
||||
|
||||
import request from '../js/request'
|
||||
import { baseUrl, formHeader, jsonHeader } from './xiao4rApis'
|
||||
import { MINI_DEPTID } from '../config'
|
||||
import { baseUrl } from '../baseDefine'
|
||||
|
||||
/**
|
||||
* 商城相关接口
|
||||
@ -15,13 +14,13 @@ class MallApis {
|
||||
}
|
||||
getGoodsById(id) {
|
||||
return request.get({
|
||||
url: baseUrl + 'goods/goods_main/' + id,
|
||||
url: baseUrl + 'goods/goods_main/' + id
|
||||
})
|
||||
}
|
||||
|
||||
getGoodsSpecByIds(ids) {
|
||||
return request.get({
|
||||
url: baseUrl + 'goods/goods_spec/listByIds/' + ids,
|
||||
url: baseUrl + 'goods/goods_spec/listByIds/' + ids
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
25
mini-app/src/apis/orderApis.js
Normal file
25
mini-app/src/apis/orderApis.js
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
import request from '../js/request'
|
||||
import { baseUrl } from '../baseDefine'
|
||||
|
||||
/**
|
||||
* 订单相关接口
|
||||
*/
|
||||
class OrderApis {
|
||||
|
||||
|
||||
/**
|
||||
* 创建订单
|
||||
* @param data
|
||||
* @returns {Promise实例对象}
|
||||
*/
|
||||
createOrders(data) {
|
||||
return request.post({
|
||||
url: baseUrl + 'winery/user_orders',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default new OrderApis()
|
||||
@ -1,7 +1,7 @@
|
||||
|
||||
import request from '../js/request'
|
||||
import { baseUrl, formHeader, jsonHeader } from './xiao4rApis'
|
||||
import { MINI_DEPTID } from '../config'
|
||||
import { baseUrl, MINI_DEPTID } from '../baseDefine'
|
||||
import { formHeader, jsonHeader } from './xiao4rApis'
|
||||
|
||||
/**
|
||||
* 用户相关接口
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
|
||||
import request from '../js/request'
|
||||
|
||||
export const baseUrl = 'http://127.0.0.1:18989/'
|
||||
// export const baseUrl = 'http://36.1.50.18:18989/winery/'
|
||||
// export const baseUrl = 'http://62.234.123.172:18989/api/'
|
||||
// export const baseUrl = 'https://www.xiao4r.com/wine/winery/'
|
||||
import { baseUrl } from '../baseDefine'
|
||||
|
||||
export const jsonHeader = {
|
||||
'Content-Type': 'application/json'
|
||||
|
||||
@ -103,6 +103,7 @@ pages: [
|
||||
'pages/mall/index',
|
||||
'pages/mall/goods-detail',
|
||||
'pages/mall/user/user-address',
|
||||
'pages/mall/user/user-address-list',
|
||||
'pages/winery/winery-detail'
|
||||
|
||||
],
|
||||
@ -147,6 +148,8 @@ usingComponents: {
|
||||
"van-dialog": "./vant/dialog/index",
|
||||
"van-image": "./vant/image/index",
|
||||
"van-loading": "./vant/loading/index",
|
||||
"van-empty": "./vant/empty/index",
|
||||
"van-notice-bar": "./vant/notice-bar/index",
|
||||
"van-area": "./vant/area/index"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
|
||||
import store from '@/store'
|
||||
import eventHub from './common/eventHub'
|
||||
|
||||
class AppManager {
|
||||
saveOpenid(openid) {
|
||||
|
||||
store.dispatch('setOpenidAction', openid)
|
||||
}
|
||||
|
||||
@ -12,24 +10,50 @@ class AppManager {
|
||||
return wx.getStorageSync('openid')
|
||||
}
|
||||
|
||||
navigateTo(url) {
|
||||
setCacheInfo() {
|
||||
const mobile = wx.getStorageSync('mobile')
|
||||
const openid = wx.getStorageSync('openid')
|
||||
const userInfo = wx.getStorageSync('userInfo')
|
||||
|
||||
console.log('setCacheInfo:', mobile)
|
||||
console.log('setCacheInfo:', openid)
|
||||
console.log('setCacheInfo:', userInfo)
|
||||
|
||||
if (mobile) {
|
||||
store.dispatch('setMobileAction', mobile)
|
||||
}
|
||||
|
||||
if (openid) {
|
||||
store.dispatch('setOpenidAction', openid)
|
||||
}
|
||||
|
||||
if (userInfo) {
|
||||
store.dispatch('setUserInfoAction', userInfo)
|
||||
}
|
||||
}
|
||||
|
||||
navigateTo(path) {
|
||||
console.log('path:', path)
|
||||
if (!store.state.user.token) {
|
||||
eventHub.$emit('onShowDialogUserInfo')
|
||||
return
|
||||
}
|
||||
|
||||
if (!url) {
|
||||
console.log('path:', path)
|
||||
|
||||
if (!path) {
|
||||
this.showToast('建设中')
|
||||
return
|
||||
}
|
||||
|
||||
console.log('path:', path)
|
||||
wx.navigateTo({
|
||||
url: url
|
||||
url: path
|
||||
})
|
||||
}
|
||||
|
||||
showToast(msg) {
|
||||
wx.showToast({title: msg, icon: 'none'})
|
||||
wx.showToast({ title: msg, icon: 'none' })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
16
mini-app/src/baseDefine.js
Normal file
16
mini-app/src/baseDefine.js
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
*
|
||||
* 各种常量
|
||||
*
|
||||
*/
|
||||
|
||||
export const baseUrl = 'http://127.0.0.1:18989/'
|
||||
// export const baseUrl = 'http://36.1.51.30:18989/'
|
||||
// export const baseUrl = 'http://36.1.50.18:18989/winery/'
|
||||
// export const baseUrl = 'http://62.234.123.172:18989/api/'
|
||||
// export const baseUrl = 'https://www.xiao4r.com/wine/winery/'
|
||||
|
||||
export const imgbaseUrl = 'https://www.xiao4r.com/xiao4rstatic/img/winery/'
|
||||
export const sysImgBaseUrl = 'https://winery-1257413599.cos.ap-beijing.myqcloud.com/'
|
||||
|
||||
export const MINI_DEPTID = 100
|
||||
@ -12,11 +12,11 @@
|
||||
|
||||
.user-banner {
|
||||
margin-top: 180px;
|
||||
border-top: 1px solid #F2F3F5;
|
||||
border-top: 1px solid #F5F6F7;
|
||||
border-top-right-radius: 20px;
|
||||
border-top-left-radius: 20px;
|
||||
text-align: left;
|
||||
background-color: #eeeeee;
|
||||
background-color: #F5F6F7;
|
||||
height: 20px;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
@ -38,7 +38,7 @@
|
||||
.grid-body {
|
||||
border: #fff 1px solid;
|
||||
border-radius: 20px;
|
||||
width: 700rpx;
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
background-color: white;
|
||||
box-shadow: 4px 4px 10px #eeeeee;
|
||||
@ -77,33 +77,44 @@
|
||||
|
||||
</style>
|
||||
<template>
|
||||
|
||||
<div class="container">
|
||||
<image class="header-image" :src="imageDefine.HOME_TITLE_IMAGE" />
|
||||
<div class="container" style="margin-bottom: 80px;" >
|
||||
<image class="header-image" :src="navDefine.HOME_HEADER.image" />
|
||||
<div class="user-banner" />
|
||||
|
||||
|
||||
<view style="margin: 10px;display: flex;flex-direction: column;">
|
||||
<van-row>
|
||||
<van-col offset="1" span="4">
|
||||
<van-image round width="80rpx" height="80rpx" :src="user.userInfo.avatar" />
|
||||
<van-image round width="96rpx" height="96rpx" :src="user.userInfo.avatarUrl" />
|
||||
</van-col>
|
||||
<van-col offset="1" span="10">
|
||||
<div class="fxc" style="display: flex;flex-direction: column;">
|
||||
<span>{{user.userInfo.nickName}}</span>
|
||||
<span style="font-size: 19px;">{{user.userInfo.nickName}}</span>
|
||||
<span>{{user.mobile}}</span>
|
||||
</div>
|
||||
</van-col>
|
||||
<van-col offset="1" span="7">
|
||||
<van-button round style="height: 25px;" size="small" plain color="#AC1630">
|
||||
<van-button round style="height: 25px;" size="small" plain color="#AC1630" @tap="onShoppingCar">
|
||||
<van-icon name="shopping-cart-o" color="#AC1630" />
|
||||
<span style="margin-left: 5px;color: #333333;">购物车</span>
|
||||
</van-button>
|
||||
</van-col>
|
||||
</van-row>
|
||||
|
||||
<van-notice-bar
|
||||
text="在代码阅读过程中人们说脏话的频率是衡量代码质量的唯一标准。"
|
||||
mode="link"
|
||||
background="#ddd"
|
||||
color="#333"
|
||||
style="margin-top: 16px;"
|
||||
>
|
||||
<van-image slot="left-icon" :src="imageDefine.HOME_NOTICE_ICON" width="18px" height="19px" style="margin-top: 5px;margin-left: 5px" />
|
||||
</van-notice-bar>
|
||||
|
||||
|
||||
<van-row style="margin-top: 20px;">
|
||||
<van-col offset="1" span="11">
|
||||
<van-col span="11">
|
||||
|
||||
|
||||
<div class="menu-desc" @tap="onNavItem(navDefine.HOME_MENU1)">
|
||||
<div class="fxc">
|
||||
@ -115,7 +126,7 @@
|
||||
</van-col>
|
||||
|
||||
|
||||
<van-col offset="1" span="11">
|
||||
<van-col offset="2" span="11">
|
||||
<div class="menu-desc" @tap="onNavItem(navDefine.HOME_MENU2)">
|
||||
<div class="fxc">
|
||||
<span>购买庄酒</span>
|
||||
@ -142,12 +153,14 @@
|
||||
|
||||
<span style="margin:15px 0;font-weight: bold;">热门活动</span>
|
||||
|
||||
<van-image width="100%" height="60px" :src="navDefine.HOME_BANNER.image" />
|
||||
<van-image width="100%" height="60px" :src="navDefine.HOME_BANNER1.image"
|
||||
@tap="onNavItem(navDefine.HOME_BANNER1)" />
|
||||
|
||||
|
||||
<span v-if="columnRecord.length > 0" style="margin:15px 0;font-weight: bold;">每日精选</span>
|
||||
|
||||
<div class="column-record-item" v-for="(item, index) in columnRecord">
|
||||
<van-image width="100%" height="60px" :src="item.image" />
|
||||
<div class="column-record-item" v-for="(item, index) in columnRecord" @tap="onNavItem(navDefine.HOME_BANNER2)">
|
||||
<van-image width="100%" height="60px" :src="navDefine.HOME_BANNER2.image" />
|
||||
<div class="column-record-item-text">
|
||||
<span>{{item.title}} </span>
|
||||
<span style="font-size: 12px;font-weight: normal;">{{item.createTime}} </span>
|
||||
@ -165,6 +178,7 @@ import wepy from '@wepy/core'
|
||||
import store from '@/store'
|
||||
import { mapActions, mapState } from '@wepy/x'
|
||||
import defaultMix from '../../../mixins/defaultMix'
|
||||
import orderApis from '../../../apis/orderApis'
|
||||
|
||||
wepy.component({
|
||||
store,
|
||||
@ -190,7 +204,43 @@ wepy.component({
|
||||
})
|
||||
},
|
||||
|
||||
methods: {},
|
||||
methods: {
|
||||
|
||||
onShoppingCar() {
|
||||
let test = {
|
||||
goodsId: '12',
|
||||
goodsName: 'test',
|
||||
goodsType: '1',
|
||||
goodsSpec: 'test',
|
||||
goodsFaceImg: 'test',
|
||||
goodsPrice: 0.1,
|
||||
goodsCount: 1,
|
||||
remark: 'test'
|
||||
}
|
||||
|
||||
orderApis.createOrders(test).then(r => {
|
||||
if (r.code !== 200) {
|
||||
return
|
||||
}
|
||||
|
||||
let payData = r.data.payMsg
|
||||
wx.requestPayment({
|
||||
appId: payData.appId,
|
||||
timeStamp: payData.timeStamp,
|
||||
nonceStr: payData.nonceStr,
|
||||
package: payData.packageValue,
|
||||
signType: payData.signType,
|
||||
paySign: payData.paySign,
|
||||
success: function(res) {
|
||||
|
||||
|
||||
},
|
||||
fail: function(res) {
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
ready() {
|
||||
|
||||
|
||||
@ -64,11 +64,10 @@
|
||||
<image class="header-image" :src="imageDefine.HOME_TITLE_IMAGE" />
|
||||
|
||||
|
||||
<div class="container" style="margin: 10px;">
|
||||
|
||||
<div class="container" style="margin: 10px 10px 80px 10px;">
|
||||
|
||||
<div class="user-info">
|
||||
<van-image round width="120rpx" height="120rpx" :src="user.userInfo.avatar" />
|
||||
<van-image round width="120rpx" height="120rpx" :src="user.userInfo.avatarUrl" />
|
||||
<div class="user-info-msg">
|
||||
<span style="font-size: 18px;">{{user.mobile}}</span>
|
||||
<span style="font-size: 12px;">{{user.userInfo.nickName}}</span>
|
||||
@ -84,7 +83,7 @@
|
||||
</div>
|
||||
<div class="header-grid-body-bottom">
|
||||
<van-grid column-num="3" border="{{ false }}" style="margin-top: 15px;">
|
||||
<van-grid-item use-slot v-for=" (item, index) in navDefine.HOME_MENU_LIST" @tap="onNavItem(item)">
|
||||
<van-grid-item use-slot v-for=" (item, index) in navDefine.MY_MENU1" @tap="onNavItem(item)">
|
||||
<van-image round width="120rpx" height="120rpx" :src="item.icon" />
|
||||
<span style="margin-top: 10px;">{{item.name}} </span>
|
||||
</van-grid-item>
|
||||
@ -94,7 +93,7 @@
|
||||
<div class="grid-body">
|
||||
<span style="margin:25px 10px 15px 10px;font-weight: bold;">常用功能</span>
|
||||
<van-grid column-num="3" border="{{ false }}" style="margin-top: 15px;">
|
||||
<van-grid-item use-slot v-for=" (item, index) in navDefine.HOME_MENU_LIST" @tap="onNavItem(item)">
|
||||
<van-grid-item use-slot v-for=" (item, index) in navDefine.MY_MENU2" @tap="onNavItem(item)">
|
||||
<van-image round width="120rpx" height="120rpx" :src="item.icon" />
|
||||
<span style="margin-top: 10px;">{{item.name}} </span>
|
||||
</van-grid-item>
|
||||
@ -104,7 +103,7 @@
|
||||
<div class="grid-body">
|
||||
<span style="margin:25px 10px 15px 10px;font-weight: bold;">更多推荐</span>
|
||||
<van-grid column-num="3" border="{{ false }}" style="margin-top: 15px;">
|
||||
<van-grid-item use-slot v-for=" (item, index) in navDefine.HOME_MENU_LIST" @tap="onNavItem(item)">
|
||||
<van-grid-item use-slot v-for=" (item, index) in navDefine.MY_MENU3" @tap="onNavItem(item)">
|
||||
<van-image round width="120rpx" height="120rpx" :src="item.icon" />
|
||||
<span style="margin-top: 10px;">{{item.name}} </span>
|
||||
</van-grid-item>
|
||||
|
||||
@ -11,7 +11,10 @@ module.exports.parseImage = parseImage;
|
||||
<van-nav-bar
|
||||
title="福利购"
|
||||
/>
|
||||
<view style="margin: 10px;">
|
||||
|
||||
|
||||
|
||||
<view style="margin: 10px 10px 80px 10px;">
|
||||
|
||||
|
||||
<van-image class="banner" :src="navDefine.HOME_BANNER.image" />
|
||||
@ -60,7 +63,6 @@ module.exports.parseImage = parseImage;
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
import wepy from '@wepy/core'
|
||||
import store from '@/store'
|
||||
import { mapActions, mapState } from '@wepy/x'
|
||||
@ -76,7 +78,8 @@ wepy.component({
|
||||
active: 0,
|
||||
records: [],
|
||||
currentFilter: '全部',
|
||||
filterButtons: ['全部']
|
||||
filterButtons: ['全部'],
|
||||
isInit: false
|
||||
|
||||
},
|
||||
|
||||
@ -100,6 +103,16 @@ wepy.component({
|
||||
},
|
||||
parseImage(imageKey) {
|
||||
return 'https://winery-1257413599.cos.ap-beijing.myqcloud.com/' + imageKey
|
||||
},
|
||||
|
||||
async init() {
|
||||
const req = await mailApis.getGoodsList()
|
||||
|
||||
if (req.code === 200) {
|
||||
this.records = req.rows
|
||||
}
|
||||
|
||||
this.isInit = true
|
||||
}
|
||||
},
|
||||
|
||||
@ -112,11 +125,6 @@ wepy.component({
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
mailApis.getGoodsList({}).then(r => {
|
||||
|
||||
this.records = r.rows
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
/**
|
||||
* 常量
|
||||
*/
|
||||
|
||||
export const MINI_DEPTID = 100
|
||||
|
||||
|
||||
|
||||
@ -7,7 +7,6 @@ export default {
|
||||
methods: {
|
||||
|
||||
onNavItem (item) {
|
||||
console.log(item)
|
||||
appManager.navigateTo(item.path)
|
||||
},
|
||||
navBack() {
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
height: 20px;
|
||||
}
|
||||
page {
|
||||
background-color: #eeeeee;
|
||||
background-color: #F5F6F7;
|
||||
}
|
||||
|
||||
</style>
|
||||
@ -89,10 +89,10 @@ module.exports.getTime = getTime;
|
||||
我的
|
||||
</van-tabbar-item>
|
||||
</van-tabbar>
|
||||
<mall-home v-if="pageIndex === 3" />
|
||||
<mall-home v-if="pageIndex === 0" />
|
||||
<mall-shopping v-else-if="pageIndex === 1" />
|
||||
<mall-bbs v-else-if="pageIndex === 2" />
|
||||
<mall-my v-else-if="pageIndex === 0" />
|
||||
<mall-my v-else-if="pageIndex === 3" />
|
||||
<dialog-registration />
|
||||
|
||||
|
||||
@ -177,7 +177,9 @@ wepy.page({
|
||||
let rsp = await userApis.loginByMini({ openid: openid })
|
||||
if (rsp.token) {
|
||||
this.setTokenAction(rsp.token)
|
||||
appManager.setCacheInfo()
|
||||
}
|
||||
|
||||
wx.hideLoading()
|
||||
}
|
||||
},
|
||||
|
||||
@ -2,133 +2,92 @@
|
||||
|
||||
|
||||
.address-item {
|
||||
border: #fff 1px solid;
|
||||
border-radius: 20px;
|
||||
|
||||
border-radius: 25px;
|
||||
width: 660rpx;
|
||||
margin-top: 20px;
|
||||
background-color: white;
|
||||
box-shadow: 4px 4px 10px #eeeeee;
|
||||
//box-shadow: 4px 4px 10px #eeeeee;
|
||||
padding: 10px 10px 0px 10px;
|
||||
font-weight: bold;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
//align-items: center;
|
||||
}
|
||||
|
||||
.van-field__label--disabled {
|
||||
|
||||
input {
|
||||
color: #333333 !important;
|
||||
|
||||
margin: 12px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.van-field__label {
|
||||
color: #333333 !important;
|
||||
}
|
||||
.van-field__input--disabled {
|
||||
color: #333333 !important;
|
||||
}
|
||||
|
||||
.cell-title {
|
||||
padding: 10px 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.cell {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.cell-input {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.cell-item {
|
||||
margin-left: 22px;
|
||||
margin-top: 12px;
|
||||
width: 300rpx;
|
||||
}
|
||||
|
||||
</style>
|
||||
<template>
|
||||
|
||||
<nav-bar :title="title" />
|
||||
<div class="container">
|
||||
<nav-bar title="地址管理" />
|
||||
|
||||
|
||||
<div class="address-item">
|
||||
<div class="cell">
|
||||
<span class="cell-title">选择收货地区</span>
|
||||
<radio-group bindchange="onChangeCountry" style="display: flex;">
|
||||
<div class="cell-item" v-for="(item,index) in countryTypes">
|
||||
<radio :value="item" :checked="item === radio" color="#AC3016">{{item}}</radio>
|
||||
<span>{{item}} </span>
|
||||
</div>
|
||||
</radio-group>
|
||||
<div class="container" style="margin: 15px;">
|
||||
|
||||
<van-loading wx:if="{{ !isInit }}" style="margin-top: 20px;"></van-loading>
|
||||
<view wx:else>
|
||||
|
||||
<div style="display: flex;align-items: center;justify-content: start;width: 100%;margin-left: 10px;">
|
||||
|
||||
<van-image :src="imageDefine.ADDRESS_ADD_IMAGE" width="60rpx" height="60rpx" @tap="onAdd" />
|
||||
<span style="margin-left: 10px;">添加收货地址</span>
|
||||
|
||||
<van-divider customStyle="margin: 10px 5px;" />
|
||||
</div>
|
||||
|
||||
<div v-if="radio=== '国内'" class="cell">
|
||||
<span class="cell-title">收货地址(省市区)</span>
|
||||
<div style="display: flex;width: 100%;">
|
||||
<picker mode="region" v-model="form.region" bindchange="bindRegionChange" style="width: 700rpx;">
|
||||
<van-field
|
||||
:value="form.region"
|
||||
required
|
||||
center
|
||||
clearable
|
||||
readonly
|
||||
placeholder="请选择"
|
||||
border="{{ false }}"
|
||||
/>
|
||||
</picker>
|
||||
<van-icon name="arrow" color="#dddddd" />
|
||||
<div v-if="records.length < 1" style="display: flex;flex-direction: column;align-items: center;width: 100%;">
|
||||
<van-empty description="您还没有添加收货地址" />
|
||||
<div style="width: 600rpx;">
|
||||
<van-button round type="info" size="large" @tap="onAdd">点击添加</van-button>
|
||||
</div>
|
||||
<van-divider customStyle="margin: 0 5px;" />
|
||||
</div>
|
||||
|
||||
<div class="cell">
|
||||
<span class="cell-title">详细地址</span>
|
||||
<div v-for="(item,index) in records" class="address-item"
|
||||
:style="{ border: item.isDefault === 1 ? '#AC1630 1px solid' : '#eeeeee 1px solid'}">
|
||||
<van-field
|
||||
:value="form.address"
|
||||
required
|
||||
center
|
||||
clearable
|
||||
label="收货人姓名"
|
||||
:value="item.name"
|
||||
disabled
|
||||
bind:change="onChangeAddress"
|
||||
use-button-slot
|
||||
/>
|
||||
<van-field
|
||||
label="手机号码"
|
||||
:value="item.mobile"
|
||||
disabled
|
||||
/>
|
||||
<van-field
|
||||
label="地址(省市区)"
|
||||
:value="item.region"
|
||||
disabled
|
||||
/>
|
||||
<van-field
|
||||
label="详细地址"
|
||||
:value="item.address"
|
||||
type="textarea"
|
||||
autosize
|
||||
placeholder="请输入详细地址"
|
||||
bind:change="onChangeAddress"
|
||||
disabled
|
||||
/>
|
||||
<van-divider customStyle="margin: 0 5px;" />
|
||||
|
||||
<div style="display: flex; justify-content:flex-end;margin: 10px;">
|
||||
<van-button round v-if="item.isDefault !== 1" color="#98002E" size="small" type="info" plain @tap="onSetDefault(item)">设为默认</van-button>
|
||||
<van-button round size="small" color="#98002E" type="info" plain style="margin-left: 20px;" @tap="onEdit(item)">编辑</van-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="cell">
|
||||
<span class="cell-title">收货人手机号码</span>
|
||||
<van-field
|
||||
:value="form.mobile"
|
||||
required
|
||||
center
|
||||
clearable
|
||||
type="number"
|
||||
placeholder="请输入手机联系电话号码"
|
||||
bind:change="onChangeMobile"
|
||||
/>
|
||||
<van-divider customStyle="margin: 0 5px;" />
|
||||
</div>
|
||||
<div class="cell">
|
||||
<span class="cell-title">收货人姓名</span>
|
||||
<van-field
|
||||
:value="form.name"
|
||||
required
|
||||
center
|
||||
clearable
|
||||
placeholder="请输入收货人姓名"
|
||||
bind:change="onChangeName"
|
||||
/>
|
||||
<van-divider customStyle="margin: 0 5px;" />
|
||||
</div>
|
||||
|
||||
|
||||
<van-button round type="info" size="large" style="margin: 20px;" @tap="onSubmit">保存</van-button>
|
||||
</div>
|
||||
|
||||
|
||||
</view>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -138,20 +97,15 @@ import store from '@/store'
|
||||
import { mapActions, mapState } from '@wepy/x'
|
||||
import defaultMix from '../../../mixins/defaultMix'
|
||||
import appManager from '../../../appManager'
|
||||
import addressApis from '../../../apis/addressApis'
|
||||
import { userAddressPage } from '../../../store/constant/nav/home'
|
||||
|
||||
wepy.page({
|
||||
store,
|
||||
hooks: {},
|
||||
data: {
|
||||
title: '添加地址',
|
||||
countryTypes: ['国内', '海外'],
|
||||
form: {
|
||||
region: ['宁夏回族自治区', '银川市', '西夏区'],
|
||||
address: '',
|
||||
mobile: '',
|
||||
name: ''
|
||||
},
|
||||
radio: '国内'
|
||||
records: [],
|
||||
isInit: false
|
||||
|
||||
},
|
||||
mixins: [defaultMix],
|
||||
@ -165,55 +119,37 @@ wepy.page({
|
||||
},
|
||||
|
||||
methods: {
|
||||
bindRegionChange(e) {
|
||||
this.form.region = e.$wx.detail.value
|
||||
},
|
||||
onChangeCountry(e) {
|
||||
this.radio = e.$wx.detail.value
|
||||
if (this.radio === '海外') {
|
||||
this.form.region = ['海外']
|
||||
} else {
|
||||
this.form.region = ['宁夏回族自治区', '银川市', '西夏区']
|
||||
}
|
||||
},
|
||||
|
||||
onSubmit() {
|
||||
onSetDefault(item) {
|
||||
item.isDefault = 1
|
||||
|
||||
console.log(this.form)
|
||||
if (this.form.region.length < 1) {
|
||||
appManager.showToast('请选择收货地区!')
|
||||
return
|
||||
addressApis.editAddress(item).then(r => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
onEdit(item) {
|
||||
appManager.navigateTo(userAddressPage + '?id=' + item.id)
|
||||
},
|
||||
onAdd() {
|
||||
appManager.navigateTo(userAddressPage)
|
||||
},
|
||||
async init() {
|
||||
this.isInit = false
|
||||
const req = await addressApis.getAddressList()
|
||||
|
||||
if (req.code === 200) {
|
||||
this.records = req.rows
|
||||
}
|
||||
|
||||
if (!this.form.address) {
|
||||
appManager.showToast('请输入收货详细地址!')
|
||||
return
|
||||
}
|
||||
if (!this.form.mobile) {
|
||||
appManager.showToast('请输入收货人手机号码!')
|
||||
return
|
||||
}
|
||||
if (!this.form.name) {
|
||||
appManager.showToast('请输入收货人姓名!')
|
||||
return
|
||||
}
|
||||
|
||||
// TODO 提交
|
||||
this.navBack()
|
||||
},
|
||||
onChangeAddress(e) {
|
||||
this.form.address = e.$wx.detail
|
||||
},
|
||||
onChangeMobile(e) {
|
||||
this.form.mobile = e.$wx.detail
|
||||
},
|
||||
onChangeName(e) {
|
||||
this.form.name = e.$wx.detail
|
||||
this.isInit = true
|
||||
}
|
||||
},
|
||||
|
||||
ready() {
|
||||
this.form.mobile = this.user.mobile
|
||||
this.init()
|
||||
},
|
||||
onShow() {
|
||||
this.init()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
.address-item {
|
||||
border: #fff 1px solid;
|
||||
border: #eeeeee 1px solid;
|
||||
border-radius: 20px;
|
||||
width: 660rpx;
|
||||
margin-top: 20px;
|
||||
@ -138,6 +138,8 @@ import store from '@/store'
|
||||
import { mapActions, mapState } from '@wepy/x'
|
||||
import defaultMix from '../../../mixins/defaultMix'
|
||||
import appManager from '../../../appManager'
|
||||
import userApis from '../../../apis/userApis'
|
||||
import addressApis from '../../../apis/addressApis'
|
||||
|
||||
wepy.page({
|
||||
store,
|
||||
@ -146,6 +148,7 @@ wepy.page({
|
||||
title: '添加地址',
|
||||
countryTypes: ['国内', '海外'],
|
||||
form: {
|
||||
id: '',
|
||||
region: ['宁夏回族自治区', '银川市', '西夏区'],
|
||||
address: '',
|
||||
mobile: '',
|
||||
@ -177,8 +180,7 @@ wepy.page({
|
||||
}
|
||||
},
|
||||
|
||||
onSubmit() {
|
||||
|
||||
async onSubmit() {
|
||||
console.log(this.form)
|
||||
if (this.form.region.length < 1) {
|
||||
appManager.showToast('请选择收货地区!')
|
||||
@ -194,7 +196,7 @@ wepy.page({
|
||||
return
|
||||
}
|
||||
|
||||
if (!(/^1[3|4|5|6|8][0-9]\d{4,8}$/.test(this.form.mobile))){
|
||||
if (!(/^1[3|4|5|6|8][0-9]\d{4,8}$/.test(this.form.mobile))) {
|
||||
appManager.showToast('请输入正确的手机号码!')
|
||||
return
|
||||
}
|
||||
@ -204,8 +206,25 @@ wepy.page({
|
||||
return
|
||||
}
|
||||
|
||||
let data = {}
|
||||
Object.assign(data, this.form)
|
||||
data.region = data.region.join(',')
|
||||
|
||||
let r;
|
||||
|
||||
if (!this.form.id) {
|
||||
r = await addressApis.createAddress(data)
|
||||
} else {
|
||||
r = await addressApis.editAddress(data)
|
||||
}
|
||||
|
||||
if (r.code === 200) {
|
||||
this.navBack()
|
||||
} else {
|
||||
appManager.showToast('保存失败')
|
||||
}
|
||||
|
||||
// TODO 提交
|
||||
this.navBack()
|
||||
},
|
||||
onChangeAddress(e) {
|
||||
this.form.address = e.$wx.detail
|
||||
@ -218,8 +237,21 @@ wepy.page({
|
||||
}
|
||||
},
|
||||
|
||||
ready() {
|
||||
onLoad(options) {
|
||||
if (options.id) {
|
||||
addressApis.getAddressById(options.id).then(r => {
|
||||
const item = r.data
|
||||
item.region = item.region.split(',')
|
||||
this.form = item
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.form.mobile = this.user.mobile
|
||||
},
|
||||
|
||||
ready() {
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -76,7 +76,7 @@ module.exports.parseImage = parseImage;
|
||||
|
||||
<div style="display: flex;" v-for="(item,index) in wineryDefine.WINERY_LIST" @tap="onTap(item)">
|
||||
<div class="winery-item-icon">
|
||||
<van-image style="margin-top: 5px;" round width="50px" height="50px" :src="userInfo.avatar" />
|
||||
<van-image style="margin-top: 5px;" round width="50px" height="50px" :src="userInfo.avatarUrl" />
|
||||
</div>
|
||||
|
||||
<div class="winery-item">
|
||||
|
||||
@ -1,17 +1,19 @@
|
||||
export const imgbaseUrl = 'https://www.xiao4r.com/xiao4rstatic/img/'
|
||||
export const sysImgBaseUrl = 'https://winery-1257413599.cos.ap-beijing.myqcloud.com/'
|
||||
import { imgbaseUrl, sysImgBaseUrl } from '../../baseDefine'
|
||||
|
||||
|
||||
export const imageDefine = {
|
||||
SYS_IMG_BASE_URL: sysImgBaseUrl,
|
||||
TAP_BAR_ICON1_ON: imgbaseUrl + 'doctor.png',
|
||||
TAP_BAR_ICON2_ON: imgbaseUrl + 'doctor.png',
|
||||
TAP_BAR_ICON3_ON: imgbaseUrl + 'doctor.png',
|
||||
TAP_BAR_ICON4_ON: imgbaseUrl + 'doctor.png',
|
||||
TAP_BAR_ICON1_OFF: imgbaseUrl + 'doctor.png',
|
||||
TAP_BAR_ICON2_OFF: imgbaseUrl + 'doctor.png',
|
||||
TAP_BAR_ICON3_OFF: imgbaseUrl + 'doctor.png',
|
||||
TAP_BAR_ICON4_OFF: imgbaseUrl + 'doctor.png',
|
||||
TAP_BAR_ICON1_OFF: imgbaseUrl + 'nav/1.png',
|
||||
TAP_BAR_ICON2_OFF: imgbaseUrl + 'nav/2.png',
|
||||
TAP_BAR_ICON3_OFF: imgbaseUrl + 'nav/3.png',
|
||||
TAP_BAR_ICON4_OFF: imgbaseUrl + 'nav/4.png',
|
||||
TAP_BAR_ICON1_ON: imgbaseUrl + 'nav/1_td.png',
|
||||
TAP_BAR_ICON2_ON: imgbaseUrl + 'nav/2_td.png',
|
||||
TAP_BAR_ICON3_ON: imgbaseUrl + 'nav/3_td.png',
|
||||
TAP_BAR_ICON4_ON: imgbaseUrl + 'nav/4_td.png',
|
||||
|
||||
HOME_TITLE_IMAGE: imgbaseUrl + 'doctor.png',
|
||||
HOME_NOTICE_ICON: imgbaseUrl + 'icon/home_wine.png',
|
||||
ADDRESS_ADD_IMAGE: imgbaseUrl + 'add.png'
|
||||
|
||||
}
|
||||
|
||||
@ -1,31 +1,48 @@
|
||||
import { imgbaseUrl } from '../imageDefine'
|
||||
import { imgbaseUrl } from '../../../baseDefine'
|
||||
|
||||
const homeImg = imgbaseUrl + 'home/'
|
||||
|
||||
export const homeHeader = {
|
||||
image: homeImg + 'home_header.png',
|
||||
path: ''
|
||||
}
|
||||
export const homeBanner1 = {
|
||||
image: homeImg + 'home_banner1.png',
|
||||
path: ''
|
||||
}
|
||||
export const homeBanner2 = {
|
||||
image: homeImg + 'home_banner2.png',
|
||||
path: ''
|
||||
}
|
||||
|
||||
export const homeMenuList = [
|
||||
{
|
||||
name: '产品追溯',
|
||||
icon: imgbaseUrl + 'doctor.png',
|
||||
icon: homeImg + 'home_grid1.png',
|
||||
path: ''
|
||||
},
|
||||
{
|
||||
name: '新品推荐',
|
||||
icon: imgbaseUrl + 'doctor.png',
|
||||
icon: homeImg + 'home_grid2.png',
|
||||
path: ''
|
||||
}, {
|
||||
name: '视频直播',
|
||||
icon: imgbaseUrl + 'doctor.png',
|
||||
icon: homeImg + 'home_grid3.png',
|
||||
path: ''
|
||||
}
|
||||
]
|
||||
export const homeBanner = {
|
||||
image: imgbaseUrl + 'doctor.png',
|
||||
image: homeImg + 'doctor.png',
|
||||
path: ''
|
||||
}
|
||||
|
||||
export const menu1 = {
|
||||
image: imgbaseUrl + 'doctor.png',
|
||||
image: homeImg + 'home_menu1.png',
|
||||
path: ''
|
||||
}
|
||||
export const menu2 = {
|
||||
image: imgbaseUrl + 'doctor.png',
|
||||
image: homeImg + 'home_menu2.png',
|
||||
path: ''
|
||||
}
|
||||
|
||||
export const userAddressPage = '/pages/mall/user/user-address'
|
||||
|
||||
51
mini-app/src/store/constant/nav/my.js
Normal file
51
mini-app/src/store/constant/nav/my.js
Normal file
@ -0,0 +1,51 @@
|
||||
import { imgbaseUrl } from '../../../baseDefine'
|
||||
|
||||
export const myMenuList1 = [
|
||||
{
|
||||
name: '全部订单',
|
||||
icon: imgbaseUrl + 'doctor.png',
|
||||
path: '/pages/mail/order/orderList'
|
||||
},
|
||||
{
|
||||
name: '待付款',
|
||||
icon: imgbaseUrl + 'doctor.png',
|
||||
path: '/pages/mail/order/orderList?orderStatus=1'
|
||||
}, {
|
||||
name: '待收货',
|
||||
icon: imgbaseUrl + 'doctor.png',
|
||||
path: '/pages/mail/order/orderList?orderStatus=2'
|
||||
}
|
||||
]
|
||||
export const myMenuList2 = [
|
||||
{
|
||||
name: '地址管理',
|
||||
icon: imgbaseUrl + 'doctor.png',
|
||||
path: '/pages/mall/user/user-address-list'
|
||||
},
|
||||
{
|
||||
name: '发票管理',
|
||||
icon: imgbaseUrl + 'doctor.png',
|
||||
path: ''
|
||||
}, {
|
||||
name: '优惠券',
|
||||
icon: imgbaseUrl + 'doctor.png',
|
||||
path: ''
|
||||
}
|
||||
]
|
||||
|
||||
export const myMenuList3 = [
|
||||
{
|
||||
name: '关注',
|
||||
icon: imgbaseUrl + 'doctor.png',
|
||||
path: ''
|
||||
},
|
||||
{
|
||||
name: '在线客服',
|
||||
icon: imgbaseUrl + 'doctor.png',
|
||||
path: ''
|
||||
}, {
|
||||
name: '条款政策',
|
||||
icon: imgbaseUrl + 'doctor.png',
|
||||
path: ''
|
||||
}
|
||||
]
|
||||
@ -1,10 +1,19 @@
|
||||
|
||||
import { homeBanner, homeMenuList, menu1, menu2 } from './nav/home'
|
||||
import { homeBanner, homeBanner1, homeBanner2, homeHeader, homeMenuList, menu1, menu2 } from './nav/home'
|
||||
import { myMenuList1, myMenuList2, myMenuList3 } from './nav/my'
|
||||
|
||||
export const navDefine = {
|
||||
HOME_MENU_LIST: homeMenuList,
|
||||
HOME_BANNER: homeBanner,
|
||||
HOME_MENU1: menu1,
|
||||
HOME_MENU2: menu2
|
||||
HOME_MENU2: menu2,
|
||||
|
||||
HOME_HEADER: homeHeader,
|
||||
HOME_BANNER1: homeBanner1,
|
||||
HOME_BANNER2: homeBanner2,
|
||||
|
||||
MY_MENU1: myMenuList1,
|
||||
MY_MENU2: myMenuList2,
|
||||
MY_MENU3: myMenuList3
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { imgbaseUrl } from './imageDefine'
|
||||
|
||||
|
||||
export const wineryDefine = {
|
||||
WINERY_LIST: [
|
||||
|
||||
@ -9,10 +9,10 @@ export default new Vuex.Store({
|
||||
state: {
|
||||
user: {
|
||||
openid: '',
|
||||
mobile: '15595184707',
|
||||
mobile: '',
|
||||
userInfo: {
|
||||
nickName: '未注册用户',
|
||||
avatar: 'https://img.yzcdn.cn/vant/cat.jpeg'
|
||||
avatarUrl: 'https://img.yzcdn.cn/vant/cat.jpeg'
|
||||
},
|
||||
token: '',
|
||||
company: '企业名称'
|
||||
@ -30,7 +30,6 @@ export default new Vuex.Store({
|
||||
},
|
||||
setOpenid(state, openid) {
|
||||
state.user.openid = openid
|
||||
console.log('state.user.openid:', state.user.openid)
|
||||
},
|
||||
setMobile(state, mobile) {
|
||||
state.user.mobile = mobile
|
||||
@ -42,11 +41,11 @@ export default new Vuex.Store({
|
||||
state.user.token = token
|
||||
},
|
||||
setWineryForm(state, form) {
|
||||
console.log('远程酒庄表单:', form)
|
||||
state.wineryForm = form
|
||||
console.log('本地酒庄表单:', state.wineryForm)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
actions: {
|
||||
setUserAction({ commit }, user) {
|
||||
commit('setUser', user)
|
||||
|
||||
@ -77,10 +77,10 @@
|
||||
.van-button--info {
|
||||
color: #fff;
|
||||
color: var(--button-info-color, #fff);
|
||||
background: yellow;
|
||||
background: var(--button-info-background-color, yellow);
|
||||
border: 1px solid yellow;
|
||||
border: var(--button-border-width, 1px) solid var(--button-info-border-color, yellow)
|
||||
background: #98002E;
|
||||
background: var(--button-info-background-color, #98002E);
|
||||
border: 1px solid #98002E;
|
||||
border: var(--button-border-width, 1px) solid var(--button-info-border-color, #98002E)
|
||||
}
|
||||
|
||||
.van-button--danger {
|
||||
|
||||
@ -1 +1,81 @@
|
||||
@import '../common/index.wxss';.van-notice-bar{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:40px;height:var(--notice-bar-height,40px);padding:0 16px;padding:var(--notice-bar-padding,0 16px);font-size:14px;font-size:var(--notice-bar-font-size,14px);color:#ed6a0c;color:var(--notice-bar-text-color,#ed6a0c);line-height:24px;line-height:var(--notice-bar-line-height,24px);background-color:#fffbe8;background-color:var(--notice-bar-background-color,#fffbe8)}.van-notice-bar--withicon{position:relative;padding-right:40px}.van-notice-bar--wrapable{height:auto;padding:8px 16px;padding:var(--notice-bar-wrapable-padding,8px 16px)}.van-notice-bar--wrapable .van-notice-bar__wrap{height:auto}.van-notice-bar--wrapable .van-notice-bar__content{position:relative;white-space:normal}.van-notice-bar__left-icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;margin-right:4px;vertical-align:middle}.van-notice-bar__left-icon,.van-notice-bar__right-icon{font-size:16px;font-size:var(--notice-bar-icon-size,16px);min-width:22px;min-width:var(--notice-bar-icon-min-width,22px)}.van-notice-bar__right-icon{position:absolute;top:10px;right:15px}.van-notice-bar__wrap{position:relative;-webkit-flex:1;flex:1;overflow:hidden;height:24px;height:var(--notice-bar-line-height,24px)}.van-notice-bar__content{position:absolute;white-space:nowrap}.van-notice-bar__content.van-ellipsis{max-width:100%}
|
||||
@import '../common/index.wxss';
|
||||
|
||||
.van-notice-bar {
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
height: 26px;
|
||||
height: var(--notice-bar-height, 26px);
|
||||
padding: 0 5px;
|
||||
/*padding: var(--notice-bar-padding, 0 16px);*/
|
||||
font-size: 14px;
|
||||
font-size: var(--notice-bar-font-size, 14px);
|
||||
color: #ed6a0c;
|
||||
color: var(--notice-bar-text-color, #ed6a0c);
|
||||
line-height: 24px;
|
||||
line-height: var(--notice-bar-line-height, 24px);
|
||||
background-color: #fffbe8;
|
||||
background-color: var(--notice-bar-background-color, #fffbe8)
|
||||
}
|
||||
|
||||
.van-notice-bar--withicon {
|
||||
position: relative;
|
||||
padding-right: 20px
|
||||
}
|
||||
|
||||
.van-notice-bar--wrapable {
|
||||
height: auto;
|
||||
padding: 8px 16px;
|
||||
padding: var(--notice-bar-wrapable-padding, 8px 16px)
|
||||
}
|
||||
|
||||
.van-notice-bar--wrapable .van-notice-bar__wrap {
|
||||
height: auto
|
||||
}
|
||||
|
||||
.van-notice-bar--wrapable .van-notice-bar__content {
|
||||
position: relative;
|
||||
white-space: normal
|
||||
}
|
||||
|
||||
.van-notice-bar__left-icon {
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
margin-right: 4px;
|
||||
vertical-align: middle
|
||||
}
|
||||
|
||||
.van-notice-bar__left-icon, .van-notice-bar__right-icon {
|
||||
margin-top: 5px;
|
||||
font-size: 16px;
|
||||
font-size: var(--notice-bar-icon-size, 16px);
|
||||
min-width: 22px;
|
||||
min-width: var(--notice-bar-icon-min-width, 22px)
|
||||
}
|
||||
|
||||
.van-notice-bar__right-icon {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
right: 5px
|
||||
}
|
||||
|
||||
.van-notice-bar__wrap {
|
||||
position: relative;
|
||||
-webkit-flex: 1;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
height: 24px;
|
||||
height: var(--notice-bar-line-height, 24px)
|
||||
}
|
||||
|
||||
.van-notice-bar__content {
|
||||
position: absolute;
|
||||
white-space: nowrap
|
||||
}
|
||||
|
||||
.van-notice-bar__content.van-ellipsis {
|
||||
max-width: 100%
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user