uniapp 会员权益判断

pull/2/head
Jruome 2023-05-23 18:08:01 +08:00
parent 9a6e45053c
commit f9c4d2b102
9 changed files with 167 additions and 150 deletions

View File

@ -3,7 +3,7 @@
v-if="dialogVisible"
title="运费模板"
:visible.sync="dialogVisible"
width="1000px"
width="70%"
:before-close="handleClose"
>
<el-form ref="ruleForm" :model="ruleForm" label-width="120px" size="mini" v-if="dialogVisible" :rules="rules">
@ -140,9 +140,9 @@
</el-form-item>
</el-col>
<el-col :span="14">
<el-form-item v-if="ruleForm.noDelivery" class="noBox" prop="shippingTemplatesNoDeliveryRespVOS">
<el-form-item v-if="ruleForm.noDelivery" class="noBox" prop="noRegion">
<el-cascader
v-model="ruleForm.shippingTemplatesNoDeliveryRespVOS"
v-model="ruleForm.noRegion"
placeholder="请选择不配送区域"
:options="cityList"
:props="props"
@ -183,7 +183,7 @@ const defaultRole = {
noDelivery: false,
free: [],
undelives: {},
shippingTemplatesNoDeliveryRespVOS: []
noRegion: []
}
const kg = '重量kg'
const m = '体积'
@ -230,7 +230,7 @@ export default {
region: [
{ required: true, message: '请选择活动区域', trigger: 'change' }
],
shippingTemplatesNoDeliveryRespVOS: [
noRegion: [
{ type: 'array', required: true, message: '请至少选择一个地区', trigger: 'change' }
],
first: [
@ -302,7 +302,7 @@ export default {
noDelivery: false,
free: [],
undelives: {},
shippingTemplatesNoDeliveryRespVOS: []
noRegion: []
}
},
changeRegion(value) {
@ -442,36 +442,60 @@ export default {
// shippingTemplatesNoDeliveryRespVOS: []
}
this.ruleForm.region.forEach((el, index) => {
el.title = el.city_ids.length > 0 ? JSON.stringify(el.city_ids) : JSON.stringify([[0, 0]])
for (var i = 0; i < el.city_ids.length; i++) {
el.city_ids[i].shift()
if(el.city_ids.length > 0){
el.cityId = el.city_ids.map(item => {
return item[2]
}).join(',')
}else{
el.cityId = 'all'
}
el.cityId = el.city_ids.length > 0 ? el.city_ids.join(',') : 'all'
})
param.shippingTemplatesRegionRespVOList = this.ruleForm.region
param.shippingTemplatesRegionRespVOList.forEach((el, index) => {
// delete el.city_ids
// delete el.city_id
})
// this.ruleForm.region.forEach((el, index) => {
// el.title = el.city_ids.length > 0 ? JSON.stringify(el.city_ids) : JSON.stringify([[0, 0]])
// for (var i = 0; i < el.city_ids.length; i++) {
// el.city_ids[i].shift()
// }
// el.cityId = el.city_ids.length > 0 ? el.city_ids.join(',') : 'all'
// })
// param.shippingTemplatesRegionRespVOList = this.ruleForm.region
// param.shippingTemplatesRegionRespVOList.forEach((el, index) => {
// // delete el.city_ids
// // delete el.city_id
// })
if (this.ruleForm.appoint) {
this.ruleForm.free.forEach((el, index) => {
el.title = el.city_ids.length > 0 ? JSON.stringify(el.city_ids) : JSON.stringify([[0, 0]])
for (var i = 0; i < el.city_ids.length; i++) {
el.city_ids[i].shift()
if(el.city_ids.length > 0){
el.cityId = el.city_ids.map(item => {
return item[2]
}).join(',')
}else{
el.cityId = 'all'
}
el.cityId = el.city_ids.length > 0 ? el.city_ids.join(',') : 'all'
})
param.shippingTemplatesFreeRespVOList = this.ruleForm.free
param.shippingTemplatesFreeRespVOList.forEach((el, index) => {
// delete el.city_ids
// delete el.city_id
})
// this.ruleForm.free.forEach((el, index) => {
// el.title = el.city_ids.length > 0 ? JSON.stringify(el.city_ids) : JSON.stringify([[0, 0]])
// for (var i = 0; i < el.city_ids.length; i++) {
// el.city_ids[i].shift()
// }
// el.cityId = el.city_ids.length > 0 ? el.city_ids.join(',') : 'all'
// })
// param.shippingTemplatesFreeRespVOList = this.ruleForm.free
// param.shippingTemplatesFreeRespVOList.forEach((el, index) => {
// // delete el.city_ids
// // delete el.city_id
// })
}
if (this.ruleForm.noDelivery) {
param.shippingTemplatesNoDeliveryRespVOS = this.ruleForm.shippingTemplatesNoDeliveryRespVOS.map(a => {
console.log(a)
return a.slice(1, 3).join(',')
}).join(',')
param.shippingTemplatesNoDeliveryRespVOS = [{
cityId:[],
}]
this.ruleForm.noRegion.forEach((item,index) => {
param.shippingTemplatesNoDeliveryRespVOS[0].cityId.push(item[2])
})
param.shippingTemplatesNoDeliveryRespVOS[0].cityId = param.shippingTemplatesNoDeliveryRespVOS[0].cityId.join(",")
}
if (this.type === 0) {
logistics.shippingSave(param).then(res => {

View File

@ -31,15 +31,6 @@
id: 0
},
onLaunch: function(option) {
// const res = memberGradeInfo().then((res) =>{
// if(res.data.some((item) => !!parseInt(item.isExist))){
// uni.setTabBarItem({
// index: 2,
// pagePath: '/pages/member_equity/index'
// })
// }
// })
let that = this;
// #ifdef H5
uni.getSystemInfo({
@ -258,7 +249,17 @@
});
}
},
onShow: function() {
onShow:async function() {
// const res = await memberGradeInfo()
// if(res.data.some((item) => !!parseInt(item.isExist))){
// uni.setTabBarItem({
// index: 0,
// pagePath: '/pages/member_equity/index'
// })
// uni.switchTab({
// url:'/pages/member_equity/index'
// })
// }
// #ifdef H5
uni.getSystemInfo({
success(e) {

View File

@ -5,11 +5,11 @@ import request from "@/utils/request.js";
* @param numType boolean true 购物车数量,false=购物车产品数量
*/
export function getCartCounts(numType,type) {
return request.get("cart/count?numType=" + numType + "&type=" + type);
return request.get("front/cart/count?numType=" + numType + "&type=" + type);
}
/**
* 获取购物车列表
*
*
*/
export function getCartList(data) {
return request.get("cart/list", data);
@ -40,7 +40,7 @@ export function cartDel(ids) {
/**
* 购物车重选提交
*
*
*/
export function getResetCart(data) {
return request.post('cart/resetcart', data);
@ -56,7 +56,7 @@ export function getOrderList(data) {
/**
* 订单产品信息
* @param string unique
* @param string unique
*/
export function orderProduct(data) {
return request.post('order/product', data);
@ -65,7 +65,7 @@ export function orderProduct(data) {
/**
* 订单评价
* @param object data
*
*
*/
export function orderComment(data) {
return request.post('order/comment', data);
@ -89,7 +89,7 @@ export function orderData() {
/**
* 订单取消
* @param string id
*
*
*/
export function orderCancel(id) {
return request.post('order/cancel', {
@ -100,7 +100,7 @@ export function orderCancel(id) {
/**
* 删除已完成订单
* @param string uni
*
*
*/
export function orderDel(uni) {
return request.post('order/del', {
@ -110,7 +110,7 @@ export function orderDel(uni) {
/**
* 订单详情
* @param string uni
* @param string uni
*/
export function getOrderDetail(uni) {
return request.get('order/detail/' + uni);
@ -119,7 +119,7 @@ export function getOrderDetail(uni) {
/**
* 再次下单
* @param string uni
*
*
*/
export function orderAgain(uni) {
return request.post('order/again', {
@ -130,7 +130,7 @@ export function orderAgain(uni) {
/**
* 订单收货
* @param string uni
*
*
*/
export function orderTake(uni) {
return request.post('order/take', {
@ -148,7 +148,7 @@ export function express(uni) {
/**
* 获取退款理由
*
*
*/
export function ordeRefundReason() {
return request.get('order/refund/reason');
@ -180,7 +180,7 @@ export function orderConfirm(cartId, isNew, addAgain,secKill,combination,bargain
/**
* 获取当前金额能使用的优惠卷
* @param string price
*
*
*/
export function getCouponsOrderPrice(preOrderNo) {
return request.get(`coupons/order/${preOrderNo}`)
@ -190,7 +190,7 @@ export function getCouponsOrderPrice(preOrderNo) {
* 订单创建
* @param string key
* @param object data
*
*
*/
export function orderCreate(data) {
return request.post('order/create', data);
@ -243,7 +243,7 @@ export function applyRefund(orderId) {
* @param object data
*/
export function preOrderApi(data) {
return request.post(`order/pre/order`, data);
return request.post(`front/order/pre/order`, data);
}
/**
@ -252,4 +252,4 @@ export function preOrderApi(data) {
*/
export function loadPreOrderApi(preOrderNo) {
return request.get(`order/load/pre/${preOrderNo}`);
}
}

View File

@ -6,7 +6,7 @@ import request from "@/utils/request.js";
*
*/
export function getProductDetail(id, type) {
return request.get('product/detail/' + id + '?type=' + type, {}, {
return request.get('front/product/detail/' + id + '?type=' + type, {}, {
noAuth: true
});
}
@ -17,12 +17,12 @@ export function getProductDetail(id, type) {
*/
// #ifndef MP
export function getProductCode(id) {
return request.get('product/code/' + id, {});
return request.get('front/product/code/' + id, {});
}
// #endif
// #ifdef MP
export function getProductCode(id) {
return request.get('product/code/' + id, {
return request.get('front/product/code/' + id, {
user_type: 'routine'
});
}
@ -34,7 +34,7 @@ export function getProductCode(id) {
* @param string category product=普通产品,product_seckill=秒杀产品
*/
export function collectAdd(id, category) {
return request.post('collect/add', {
return request.post('front/collect/add', {
id: id,
'category': category === undefined ? 'product' : category
});
@ -62,7 +62,7 @@ export function collectDelete(ids) {
*
*/
export function postCartAdd(data) {
return request.post('cart/save', data, {});
return request.post('front/cart/save', data, {});
}
/**
@ -146,7 +146,7 @@ export function getReplyList(id, data) {
* @param int id
*/
export function getReplyConfig(id) {
return request.get('reply/config/' + id,{},{
return request.get('front/reply/config/' + id,{},{
noAuth: true
});
}
@ -175,7 +175,7 @@ export function storeListApi(data) {
* @param object data
*/
export function getProductGood() {
return request.get('product/good');
return request.get('front/product/good');
}
/**
@ -185,7 +185,7 @@ export function getProductGood() {
*
*/
export function getReplyProduct(id) {
return request.get('reply/product/' + id, {
return request.get('front/reply/product/' + id, {
noAuth: true
})
}

View File

@ -1,51 +1,8 @@
{
"name": "yudao-ui-app",
"version": "1.0.0",
"lockfileVersion": 2,
"lockfileVersion": 1,
"requires": true,
"packages": {
"": {
"name": "yudao-ui-app",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"clipboard": "^2.0.11"
}
},
"node_modules/clipboard": {
"version": "2.0.11",
"resolved": "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.11.tgz",
"integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==",
"dependencies": {
"good-listener": "^1.2.2",
"select": "^1.1.2",
"tiny-emitter": "^2.0.0"
}
},
"node_modules/delegate": {
"version": "3.2.0",
"resolved": "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz",
"integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=="
},
"node_modules/good-listener": {
"version": "1.2.2",
"resolved": "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz",
"integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==",
"dependencies": {
"delegate": "^3.1.2"
}
},
"node_modules/select": {
"version": "1.1.2",
"resolved": "https://registry.npmmirror.com/select/-/select-1.1.2.tgz",
"integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA=="
},
"node_modules/tiny-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
}
},
"dependencies": {
"clipboard": {
"version": "2.0.11",

View File

@ -574,34 +574,41 @@
"borderStyle": "white",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/index/index",
"iconPath": "static/images/tabbar/nav_icon_shop.png",
"selectedIconPath": "static/images/tabbar/nav_icon_shop_active.png",
"text": "商城"
},
{
"pagePath": "pages/goods_cate/goods_cate",
"iconPath": "static/images/tabbar/nav_icon_sort.png",
"selectedIconPath": "static/images/tabbar/nav_icon_sort_active.png",
"text": "分类"
},
// {
// "pagePath": "pages/index/index",
// "iconPath": "static/images/tabbar/nav_icon_shop.png",
// "selectedIconPath": "static/images/1-002.png",
// "text": "商城"
// },
// {
// "pagePath": "pages/goods_cate/goods_cate",
// "iconPath": "static/images/tabbar/nav_icon_sort.png",
// "selectedIconPath": "static/images/2-002.png",
// "text": "分类"
// },
{
"pagePath": "pages/member_application/index",
"iconPath": "static/images/tabbar/nav_icon_member.png",
"iconPath": "static/images/2-001.png",
"selectedIconPath": "static/images/tabbar/nav_icon_member_active.png",
"text": "会员申请"
},
{
"pagePath": "pages/order_addcart/order_addcart",
"iconPath": "static/images/tabbar/nav_icon_cart.png",
"selectedIconPath": "static/images/tabbar/nav_icon_cart_active.png",
"text": "购物车"
},
{
"pagePath": "pages/member_equity/index",
"iconPath": "static/images/2-001.png",
"selectedIconPath": "static/images/tabbar/nav_icon_member_active.png",
"text": "会员申请",
"visible":false
},
// {
// "pagePath": "pages/order_addcart/order_addcart",
// "iconPath": "static/images/tabbar/nav_icon_cart.png",
// "selectedIconPath": "static/images/3-002.png",
// "text": "购物车"
// },
{
"pagePath": "pages/user/index",
"iconPath": "static/images/tabbar/nav_icon_my.png",
"selectedIconPath": "static/images/tabbar/nav_icon_my_active.png",
"selectedIconPath": "static/images/4-002.png",
"text": "我的"
}
]

View File

@ -90,7 +90,7 @@
</view>
<view class='iconfont icon-jiantou'></view>
</view>
<view class='userEvaluation' id="past1">
<!-- <view class='userEvaluation' id="past1">
<view class='title acea-row row-between-wrapper'
:style="replyCount==0?'border-bottom-left-radius:14rpx;border-bottom-right-radius:14rpx;':''">
<view>用户评价<i>({{replyCount}})</i></view>
@ -103,7 +103,7 @@
<block v-if="replyCount">
<userEvaluation :reply="reply"></userEvaluation>
</block>
</view>
</view> -->
<!-- 优品推荐 -->
<view class="superior borRadius14" if='good_list.length' id="past2">
<view class="title acea-row row-center-wrapper">
@ -463,7 +463,7 @@
setTimeout(()=>{
spread(mapeMpQrCodeValue.spread).then(res => {}).catch(res => {})
},2000)
} else {
this.id = options.id;
}
@ -560,7 +560,7 @@
},
/**
* 购物车手动填写
*
*
*/
iptCartNum: function(e) {
this.$set(this.attr.productSelect, 'cart_num', e ? e : 1);
@ -598,7 +598,7 @@
}
},
/*
*去商品详情页
*去商品详情页
*/
goDetail(item) {
if (!item.activityH5) {
@ -646,7 +646,7 @@
},
/**
* 购物车数量加和数量减
*
*
*/
ChangeCartNum: function(changeValue) {
//changeValue: |
@ -679,7 +679,7 @@
},
/**
* 属性变动赋值
*
*
*/
ChangeAttr: function(res) {
let productSelect = this.productValue[res];
@ -723,7 +723,7 @@
},
/**
* 优品推荐
*
*
*/
getGoods() {
getProductGood().then(res => {
@ -751,7 +751,7 @@
},
/**
* 获取产品详情
*
*
*/
getGoodsDetails: function() {
let that = this;
@ -859,7 +859,7 @@
},
/**
* 打开地图
*
*
*/
showMaoLocation: function() {
if (!this.systemStore.latitude || !this.systemStore.longitude) return this.$util.Tips({
@ -876,7 +876,7 @@
},
/**
* 默认选中属性
*
*
*/
DefaultSelect: function() {
let productAttr = this.attr.productAttr;
@ -939,7 +939,7 @@
},
/**
* 获取优惠券
*
*
*/
getCouponList(type) {
let that = this,
@ -969,9 +969,9 @@
that.$set(that.coupon, 'list', that.coupon.list);
that.$set(that.coupon, 'coupon', false);
},
/**
*
*
/**
*
*
* 收藏商品
*/
setCollect: function() {
@ -1015,7 +1015,7 @@
},
/**
* 打开属性加入购物车
*
*
*/
joinCart: function(e) {
//
@ -1125,7 +1125,7 @@
},
/**
* 分享打开
*
*
*/
listenerActionSheet: function() {
if (this.isLogin === false) {

View File

@ -107,15 +107,23 @@
});
try{
const res = await memberGradeInfo()
if(res.data.some((item) => !!parseInt(item.isExist))){
uni.setTabBarItem({
index: 0,
pagePath: '/pages/member_equity/index'
})
uni.switchTab({
url:'/pages/member_equity/index'
})
}
if(res.data.some((item) => !!parseInt(item.isExist))){
uni.setTabBarItem({
index: 0,
pagePath: '/pages/member_equity/index'
})
uni.switchTab({
url:'/pages/member_equity/index'
})
}else{
uni.setTabBarItem({
index: 0,
pagePath: '/pages/member_application/index'
})
uni.switchTab({
url:'/pages/member_application/index'
})
}
this.memberData = res.data
} finally{
uni.hideLoading();

View File

@ -62,7 +62,8 @@
<script>
import {
memberHeadInfo
memberHeadInfo,
memberGradeInfo
} from '@/api/member.js';
import {
mapGetters
@ -89,6 +90,25 @@
},
computed: mapGetters(['userInfo']),
async onLoad() {
const resful = await memberGradeInfo()
if(resful.data.some((item) => !!parseInt(item.isExist))){
uni.setTabBarItem({
index: 0,
pagePath: '/pages/member_equity/index'
})
uni.switchTab({
url:'/pages/member_equity/index'
})
}else{
uni.setTabBarItem({
index: 0,
pagePath: '/pages/member_application/index'
})
uni.switchTab({
url:'/pages/member_application/index'
})
}
const res = await memberHeadInfo()
this.memberDetail = res.data
},