4.21
@ -117,6 +117,7 @@ import { onLoad, onUnload,onNavigationBarButtonTap } from '@dcloudio/uni-app';
|
||||
import { initChat, logout } from './entry-chat-only.ts';
|
||||
|
||||
onLoad((options) => {
|
||||
console.dir(options)
|
||||
initChat(options);
|
||||
});
|
||||
|
||||
@ -136,7 +137,7 @@ const groupID = ref(undefined);
|
||||
const isGroup = ref(false);
|
||||
const isNotInGroup = ref(false);
|
||||
const notInGroupReason = ref<number>();
|
||||
const currentConversationID = ref();
|
||||
const currentConversationID = ref("");
|
||||
const isMultipleSelectMode = ref(false);
|
||||
const inputToolbarDisplayType = ref<ToolbarDisplayType>('none');
|
||||
const messageInputRef = ref();
|
||||
|
@ -19,7 +19,7 @@ export function getRegionsById(id = 0) {
|
||||
// 获取IM接口前缀
|
||||
export function getIMDetail() {
|
||||
return http.request({
|
||||
url: `${api.common}/IM`,
|
||||
url: `${api.common}/common/IM`,
|
||||
method: Method.GET,
|
||||
message: false,
|
||||
});
|
||||
|
52
api/goods.js
@ -118,8 +118,58 @@ export function getCategoryList(id) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 达人申请
|
||||
* @param parent_id
|
||||
*/
|
||||
export function getMon(params) {
|
||||
return http.request({
|
||||
url: `/expert/applyExpert`,
|
||||
method: Method.POST,
|
||||
loading: false,
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
// 申请店铺第一步-填写企业信息
|
||||
export function applyFirst (params) {
|
||||
return http.request({
|
||||
url: '/store/store/apply/first',
|
||||
// needToken: true,
|
||||
method: Method.PUT,
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 申请店铺第一步-填写企业信息
|
||||
export function applySecond (params) {
|
||||
return http.request({
|
||||
url: '/store/store/apply/second',
|
||||
needToken: true,
|
||||
method: Method.PUT,
|
||||
params
|
||||
})
|
||||
}
|
||||
// 申请店铺第一步-填写企业信息
|
||||
export function applyThird (params) {
|
||||
return http.request({
|
||||
url: '/store/store/apply/third',
|
||||
needToken: true,
|
||||
method: Method.PUT,
|
||||
params
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 店铺申请
|
||||
* @param parent_id
|
||||
*/
|
||||
export function getMonapplyStore(params) {
|
||||
return http.request({
|
||||
url: `/expert/store/applyStore`,
|
||||
method: Method.POST,
|
||||
loading: false,
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前会员的分销商信息 可根据分销商信息查询待提现金额以及冻结金额等信息
|
||||
|
@ -315,6 +315,28 @@ export function getMemberstate(params) {
|
||||
data:params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 获取二维码
|
||||
*/
|
||||
export function geterwei(params) {
|
||||
return http.request({
|
||||
url: "/member/friend/qrcode",
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
data:params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 获取二维码解析
|
||||
*/
|
||||
export function geterweijki(params) {
|
||||
return http.request({
|
||||
url: "/member/friend/parse-post?qrContent="+encodeURIComponent(params),
|
||||
method: Method.POST,
|
||||
needToken: true,
|
||||
// data:
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 获取站内信删除
|
||||
*/
|
||||
|
24
api/point.js
@ -12,8 +12,28 @@ export function sign() {
|
||||
needToken: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取推荐码
|
||||
* @param params
|
||||
*/
|
||||
export function mymon() {
|
||||
return http.request({
|
||||
url: '/share/code/my',
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 绑定推荐码
|
||||
* @param params
|
||||
*/
|
||||
export function inviteCode(data) {
|
||||
return http.request({
|
||||
url: '/share/code/bind/'+data,
|
||||
method: Method.POST,
|
||||
needToken: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 签到时间获取
|
||||
|
15
api/trade.js
@ -58,6 +58,21 @@ export function addToCart(data) {
|
||||
data,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 本地购物车生成订单
|
||||
* @param skuId 产品ID
|
||||
* @param num 产品的购买数量
|
||||
* @param cartType 购物车类型,默认加入购物车
|
||||
*/
|
||||
export function orderaddToCart(data) {
|
||||
return http.request({
|
||||
url: "/order/createWithVerification",
|
||||
method: Method.POST,
|
||||
needToken: true,
|
||||
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -18,12 +18,18 @@
|
||||
border-radius="20"
|
||||
class="uimage"
|
||||
height="200rpx"
|
||||
:src="selectedSpecImg ? selectedSpecImg : goodsDetail.thumbnail"
|
||||
:src=" selectedSpecImg ? selectedSpecImg : imgfun(goodsDetail.thumbnail)"
|
||||
></u-image>
|
||||
</view>
|
||||
<view class="goods-skus">
|
||||
<!-- 有活动商品价格 -->
|
||||
<view class="goods-price" v-if="goodsDetail.promotionPrice && ((isGroup && buyType === 'PINTUAN') || !isGroup)">
|
||||
<view
|
||||
class="goods-price"
|
||||
v-if="
|
||||
goodsDetail.promotionPrice &&
|
||||
((isGroup && buyType === 'PINTUAN') || !isGroup)
|
||||
"
|
||||
>
|
||||
<span v-if="goodsDetail.promotionPrice && !pointDetail">
|
||||
¥
|
||||
<span class="goods-price-promotionShow goods-price-bigshow">{{
|
||||
@ -78,7 +84,9 @@
|
||||
<!-- 正常逻辑 循环出sku -->
|
||||
<view
|
||||
v-if="!parentOrder"
|
||||
:class="{ active: spec_val.value == currentSelceted[specIndex] }"
|
||||
:class="{
|
||||
active: spec_val.value == currentSelceted[specIndex],
|
||||
}"
|
||||
class="skus-view-item"
|
||||
v-for="(spec_val, spec_index) in spec.values"
|
||||
:key="spec_index"
|
||||
@ -89,7 +97,9 @@
|
||||
<!-- 拼团购买,仅筛选出当前拼团类型商品 -->
|
||||
<view
|
||||
v-if="parentOrder && spec_val.skuId == goodsDetail.id"
|
||||
:class="{ active: spec_val.value == currentSelceted[specIndex] }"
|
||||
:class="{
|
||||
active: spec_val.value == currentSelceted[specIndex],
|
||||
}"
|
||||
class="skus-view-item"
|
||||
v-for="(spec_val, spec_index) in spec.values"
|
||||
:key="spec_index"
|
||||
@ -118,11 +128,17 @@
|
||||
<view class="btns">
|
||||
<view
|
||||
class="box-btn card"
|
||||
v-if="buyType != 'PINTUAN' && goodsDetail.goodsType != 'VIRTUAL_GOODS'"
|
||||
v-if="
|
||||
buyType != 'PINTUAN' &&
|
||||
goodsDetail.goodsType != 'VIRTUAL_GOODS' &&
|
||||
ste == 1
|
||||
"
|
||||
@click="addToCartOrBuy('cart')"
|
||||
>加入购物车</view
|
||||
>
|
||||
<view class="box-btn buy" @click="addToCartOrBuy('buy')">立即购买</view>
|
||||
<view class="box-btn buy" @click="addToCartOrBuy('buy')"
|
||||
>立即购买</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
@ -131,7 +147,7 @@
|
||||
<script>
|
||||
import * as API_trade from "@/api/trade.js";
|
||||
import setup from "./popup";
|
||||
|
||||
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -154,17 +170,23 @@ export default {
|
||||
currentSelceted: [],
|
||||
skuList: "",
|
||||
isClose: false, //是否可以点击遮罩关闭
|
||||
ste: 0,
|
||||
// 存储备注
|
||||
remarkVal: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.ste = uni.getStorageSync("ste");
|
||||
},
|
||||
props: {
|
||||
buyMask: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
isGroup: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
isGroup: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
goodsDetail: {
|
||||
default: "",
|
||||
type: null,
|
||||
@ -255,7 +277,14 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 跳转
|
||||
*/
|
||||
navigateTo(url) {
|
||||
uni.navigateTo({
|
||||
url,
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 直接购买
|
||||
*/
|
||||
@ -284,11 +313,11 @@ export default {
|
||||
});
|
||||
return;
|
||||
}
|
||||
const storedSte = uni.getStorageSync('ste');
|
||||
const storedSte = uni.getStorageSync("ste");
|
||||
let data = {
|
||||
skuId: this.goodsDetail.id,
|
||||
num: this.num,
|
||||
ste:storedSte
|
||||
ste: storedSte,
|
||||
};
|
||||
|
||||
if (val == "cart") {
|
||||
@ -312,13 +341,15 @@ export default {
|
||||
} else {
|
||||
data.cartType = "BUY_NOW";
|
||||
}
|
||||
|
||||
//商城填写订单
|
||||
API_trade.addToCart(data).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
||||
this.addr.id || ""
|
||||
}&parentOrder=${encodeURIComponent(JSON.stringify(this.parentOrder))}`,
|
||||
}&parentOrder=${encodeURIComponent(
|
||||
JSON.stringify(this.parentOrder)
|
||||
)}`,
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -328,8 +359,8 @@ export default {
|
||||
// 格式化数据
|
||||
let arr = [{}];
|
||||
|
||||
if(!Array.isArray(list)){
|
||||
return false
|
||||
if (!Array.isArray(list)) {
|
||||
return false;
|
||||
}
|
||||
list.forEach((item, index) => {
|
||||
item.specValues.forEach((spec, specIndex) => {
|
||||
@ -402,12 +433,13 @@ export default {
|
||||
@import "./popup.scss";
|
||||
|
||||
.buy {
|
||||
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
||||
|
||||
background-color: $aider-light-color ;
|
||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
||||
}
|
||||
|
||||
.card {
|
||||
background-image: linear-gradient(135deg, #f2140c, #f2270c 70%, #f24d0c);
|
||||
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="goods-list">
|
||||
<div @click="handleClick(item)" class="goods-item" v-for="(item, item_index) in goodsList" :key="item_index">
|
||||
<div class="goods-img">
|
||||
<u-image :src="item.content.thumbnail" mode="aspectFill" height="350rpx" width="100%">
|
||||
<u-image :src="imgfun(item.content.thumbnail)" mode="aspectFill" height="350rpx" width="100%">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
</div>
|
||||
|
@ -1,7 +1,12 @@
|
||||
<template>
|
||||
<!-- 遮罩层 -->
|
||||
<u-popup @close="close" v-model="show" mode="bottom" border-radius="30" height="260rpx">
|
||||
|
||||
<u-popup
|
||||
@close="close"
|
||||
v-model="show"
|
||||
mode="bottom"
|
||||
border-radius="30"
|
||||
height="260rpx"
|
||||
>
|
||||
<view class="share-title">
|
||||
<span>分享至</span>
|
||||
</view>
|
||||
@ -14,7 +19,12 @@
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="share-item" @click="handleShare(item)" v-for="(item, index) in list" :key="index">
|
||||
<view
|
||||
class="share-item"
|
||||
@click="handleShare(item)"
|
||||
v-for="(item, index) in list"
|
||||
:key="index"
|
||||
>
|
||||
<u-icon :color="item.color" size="80" :name="item.icon"></u-icon>
|
||||
<view>{{ item.title }}</view>
|
||||
</view>
|
||||
@ -22,7 +32,7 @@
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="share-item" @click="copyLink()">
|
||||
<u-icon color="#b4aee8" size="80" name="share-fill"></u-icon>
|
||||
<view>{{ '复制链接' }}</view>
|
||||
<view>{{ "复制链接" }}</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
@ -52,12 +62,18 @@ export default {
|
||||
icon: "weixin-circle-fill",
|
||||
type: 1,
|
||||
},
|
||||
{
|
||||
color: "#04BE02",
|
||||
title: "消息",
|
||||
icon: "weixin-circle-fill",
|
||||
type: 2,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
// 图片缩略图、 商品名称 、 type(goods,shop,pintuan) 拼团商品分享以及店铺分享
|
||||
|
||||
props: ["thumbnail", "goodsName", "type", "goodsId", "link"],
|
||||
props: ["thumbnail", "goodsName", "type", "goodsId", "link","price"],
|
||||
methods: {
|
||||
close() {
|
||||
this.$emit("close");
|
||||
@ -137,6 +153,39 @@ export default {
|
||||
},
|
||||
});
|
||||
}
|
||||
if (val.type == 2) {
|
||||
// 优化复制逻辑,确保内容存在
|
||||
// props: ["thumbnail", "goodsName", "type", "goodsId", "link","price"],
|
||||
// console.log(this.link,'===')
|
||||
// const mofn=JSON.stringify('名字:'+this.goodsName+',价格:'+this.price+','+this.link)
|
||||
|
||||
const mofn=this.goodsName+','+this.price+','+this.thumbnail.split('?')[0].split('com')[1]+','+this.link.split('?')[1]
|
||||
// const mofn={nage:this.goodsName,price:this.price,img:this.thumbnail.split('?')[0],link:this.link}
|
||||
console.log('===+++',mofn.split(',')[1])
|
||||
console.log('===+++',this.thumbnail)
|
||||
console.log('===+++',mofn.split(',')[3])
|
||||
// uni.setClipboardData({
|
||||
// data: mofn,
|
||||
// success: () => {
|
||||
// uni.showToast({
|
||||
// title: "复制成功",
|
||||
// icon: "none",
|
||||
// });
|
||||
// uni.switchTab({
|
||||
// url: "/pages/tabbar/im/index",
|
||||
// fail: (err) => {
|
||||
// console.error("跳转失败--:", err); // 查看具体错误
|
||||
// },
|
||||
// });
|
||||
|
||||
// },
|
||||
// fail: () => {
|
||||
// uni.showToast({
|
||||
// title: "不支持",
|
||||
// });
|
||||
// },
|
||||
// });
|
||||
}
|
||||
},
|
||||
// #endif
|
||||
},
|
||||
|
@ -7,19 +7,19 @@ const dev = {
|
||||
// common: "https://common-api.pickmall.cn",
|
||||
// buyer: "https://buyer-api.pickmall.cn",
|
||||
|
||||
common: "http://192.168.1.200:8890",
|
||||
buyer: "http://192.168.1.200:8888",
|
||||
vlog: "http://192.168.1.200:8099",
|
||||
web: "http://192.168.1.200:8099",
|
||||
common: "http://192.168.1.211:8890",
|
||||
buyer: "http://192.168.1.211:8888",
|
||||
vlog: "http://192.168.1.211:8099",
|
||||
web: "http://192.168.1.211:8099",
|
||||
|
||||
};
|
||||
// 生产环境
|
||||
const prod = {
|
||||
// common: "https://common-api.pickmall.cn",
|
||||
// buyer: "https://buyer-api.pickmall.cn",
|
||||
common: "http://192.168.1.200:8890",
|
||||
buyer: "http://192.168.1.200:8888",
|
||||
vlog: "http://192.168.1.200:8099",
|
||||
common: "http://192.168.1.211:8890",
|
||||
buyer: "http://192.168.1.211:8888",
|
||||
vlog: "http://192.168.1.211:8099",
|
||||
};
|
||||
|
||||
//默认生产环境
|
||||
|
@ -12,5 +12,6 @@ export default {
|
||||
iosAppId:"id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看
|
||||
logo:"https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址
|
||||
customerServiceMobile:"13161366885", //客服电话
|
||||
customerServiceEmail:"lili@lili.com" //客服邮箱
|
||||
customerServiceEmail:"lili@lili.com", //客服邮箱
|
||||
img:'https://wzjbucket.oss-rg-china-mainland.aliyuncs.com', //图片地址,聊天分享的图片地址
|
||||
};
|
||||
|
5
main.js
@ -51,3 +51,8 @@ const app = new Vue({
|
||||
...App,
|
||||
});
|
||||
app.$mount();
|
||||
|
||||
// 全局方法 imgfun
|
||||
Vue.prototype.imgfun = function(val) {
|
||||
return val.split("?")[0];
|
||||
};
|
||||
|
70
pages.json
@ -20,7 +20,8 @@
|
||||
"navigationBarTitleText": "商城",
|
||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||
"navigationBarTextStyle": "black",
|
||||
"enablePullDownRefresh": true
|
||||
"enablePullDownRefresh": true,
|
||||
"onReachBottomDistance": 50
|
||||
}
|
||||
},
|
||||
|
||||
@ -551,7 +552,54 @@
|
||||
{
|
||||
"root": "pages/mine",
|
||||
"pages": [
|
||||
|
||||
{
|
||||
"path": "mydistribution/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的分销"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "makeMoney/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "赚钱"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "invite",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的推荐"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "inviteinput",
|
||||
"style": {
|
||||
"navigationBarTitleText": "输入邀请码"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "expert/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "达人申请"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "openShop/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "店铺申请"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "openShop/secon",
|
||||
"style": {
|
||||
"navigationBarTitleText": "店铺申请"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "openShop/ThirdApply",
|
||||
"style": {
|
||||
"navigationBarTitleText": "店铺申请"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "signIn",
|
||||
"style": {
|
||||
@ -851,6 +899,24 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "vengoods",
|
||||
"style": {
|
||||
"backgroundColor": "#fff",
|
||||
"navigationStyle": "custom",
|
||||
"app-plus": {
|
||||
// 将回弹属性关掉
|
||||
"bounce": "none",
|
||||
// 禁止页面滚动
|
||||
"scrollIndicator": "none",
|
||||
"safearea": {
|
||||
"bottom": {
|
||||
"offset": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "askList",
|
||||
"style": {
|
||||
|
@ -149,7 +149,6 @@
|
||||
parms.sn = this.sn;
|
||||
parms.orderType = this.orderType;
|
||||
parms.clientType = this.paymentType;
|
||||
|
||||
API_Trade.getCashierData(parms).then((res) => {
|
||||
|
||||
if(res.data.success){
|
||||
|
333
pages/mine/expert/index.vue
Normal file
@ -0,0 +1,333 @@
|
||||
<template>
|
||||
<view style="padding: 10px">
|
||||
<u-form :model="form" ref="uForm" :rules="rules">
|
||||
<u-form-item label="姓名"
|
||||
><u-input v-model="form.name" placeholder="请输入您真实姓名"
|
||||
/></u-form-item>
|
||||
<u-form-item label="性别">
|
||||
<u-radio-group v-model="form.sex" style="margin-left: 30px">
|
||||
<u-radio
|
||||
v-for="(item, index) in radioList"
|
||||
:key="index"
|
||||
:name="item.value"
|
||||
:value="item.value"
|
||||
:disabled="item.disabled"
|
||||
>
|
||||
{{ item.name }}
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item label="联系方式"
|
||||
><u-input v-model="form.contact" placeholder="请输入"
|
||||
/></u-form-item>
|
||||
<u-form-item label="店铺地址"
|
||||
><u-input v-model="form.residenceAddress" placeholder="请输入"
|
||||
/></u-form-item>
|
||||
<u-form-item label="营业执照">
|
||||
<u-upload
|
||||
:action="action"
|
||||
:header="{ accessToken: storage.getAccessToken() }"
|
||||
max-count="1"
|
||||
style="margin-left: 30px"
|
||||
@on-uploaded="onUploaded"
|
||||
></u-upload>
|
||||
<!-- <u-input v-model="form.businessLicense" placeholder="请输入"/> -->
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="证件类别"
|
||||
><u-input v-model="idType" type="select" @click="show = true" />
|
||||
<u-action-sheet
|
||||
:list="actionSheetList"
|
||||
v-model="show"
|
||||
@click="actionSheetCallback"
|
||||
></u-action-sheet>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="证件照片">
|
||||
<u-upload
|
||||
:header="{ accessToken: storage.getAccessToken() }"
|
||||
max-count="2"
|
||||
:action="action"
|
||||
@on-uploaded="onUploadedtwo"
|
||||
style="margin-left: 30px"
|
||||
></u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="证件有效期" right-icon="arrow-right">
|
||||
<u-input
|
||||
v-model="form.idExpiryDate"
|
||||
placeholder="请输入"
|
||||
@click="showtime = true"
|
||||
/>
|
||||
<u-calendar
|
||||
v-model="showtime"
|
||||
mode="date"
|
||||
@change="changetime"
|
||||
max-date="30000"
|
||||
></u-calendar>
|
||||
</u-form-item>
|
||||
<u-form-item label="经营范围">
|
||||
<u-checkbox-group
|
||||
@change="checkboxGroupChange"
|
||||
style="margin-left: 30px"
|
||||
>
|
||||
<u-checkbox
|
||||
v-model="item.checked"
|
||||
v-for="(item, index) in cateList"
|
||||
:key="index"
|
||||
:name="item.id"
|
||||
>{{ item.name }}</u-checkbox
|
||||
>
|
||||
</u-checkbox-group>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<button @click="consub" :style="{ background: '#FE3C3C' }"
|
||||
class="bunem">提交</button>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import storage from "@/utils/storage.js";
|
||||
import { upload } from "@/api/common.js";
|
||||
import { getCategoryList, getMon } from "@/api/goods.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
action: upload,
|
||||
storage: storage,
|
||||
form: {
|
||||
name: "",
|
||||
sex: "",
|
||||
contact: "",
|
||||
residenceAddress: "",
|
||||
businessLicense: "",
|
||||
idType: "",
|
||||
idPhoto: [],
|
||||
idExpiryDate: "",
|
||||
businessAddress: "",
|
||||
businessScope: "",
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: "姓名不能为空",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
sex: [
|
||||
{
|
||||
required: true,
|
||||
message: "性别不能为空",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
contact: [
|
||||
{
|
||||
required: true,
|
||||
message: "联系方式不能为空",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
residenceAddress: [
|
||||
{
|
||||
required: true,
|
||||
message: "居住地址不能为空",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
businessLicense: [
|
||||
{
|
||||
required: true,
|
||||
message: "营业执照不能为空",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
idType: [
|
||||
{
|
||||
required: true,
|
||||
message: "证件类别不能为空",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
idPhoto: [
|
||||
{
|
||||
required: true,
|
||||
message: "证件照片不能为空",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
idExpiryDate: [
|
||||
{
|
||||
required: true,
|
||||
message: "证件有效期不能为空",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
businessAddress: [
|
||||
{
|
||||
required: true,
|
||||
message: "经营范围不能为空",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
},
|
||||
idType: "",
|
||||
radioList: [
|
||||
{
|
||||
name: "男",
|
||||
disabled: false,
|
||||
value: "MALE",
|
||||
},
|
||||
{
|
||||
name: "女",
|
||||
disabled: false,
|
||||
value: "FEMALE",
|
||||
},
|
||||
],
|
||||
showtime: false, // 控制u-calendar的显示与隐藏
|
||||
show: false, // 控制actionSheet的显示与隐藏--证件
|
||||
// 证件
|
||||
actionSheetList: [
|
||||
{
|
||||
text: "身份证",
|
||||
value: "ID",
|
||||
},
|
||||
{
|
||||
text: "护照",
|
||||
value: "PASSPORT",
|
||||
},
|
||||
{
|
||||
text: "其他",
|
||||
value: "OTHER",
|
||||
},
|
||||
],
|
||||
radio: "",
|
||||
switchVal: false,
|
||||
cateList: [],
|
||||
};
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
// 页面加载时可以初始化数据
|
||||
},
|
||||
onShow() {
|
||||
// 页面显示时可以执行一些操作
|
||||
},
|
||||
mounted() {
|
||||
this.getCategoryList(); // 调用获取分类列表的方法
|
||||
},
|
||||
methods: {
|
||||
//点击actionSheet回调--证件
|
||||
actionSheetCallback(index) {
|
||||
this.form.idType = this.actionSheetList[index].value;
|
||||
this.idType = this.actionSheetList[index].text;
|
||||
},
|
||||
consub() {
|
||||
const {
|
||||
name,
|
||||
sex,
|
||||
contact,
|
||||
residenceAddress,
|
||||
businessLicense,
|
||||
idType,
|
||||
idPhoto,
|
||||
idExpiryDate,
|
||||
businessAddress,
|
||||
businessScope,
|
||||
} = this.form;
|
||||
if (
|
||||
name == "" ||
|
||||
sex == "" ||
|
||||
contact == "" ||
|
||||
residenceAddress == "" ||
|
||||
businessLicense.length == 0 ||
|
||||
idType == "" ||
|
||||
idPhoto.length == 0 ||
|
||||
idExpiryDate == "" ||
|
||||
businessScope.length == 0
|
||||
) {
|
||||
this.$refs.uToast.show({
|
||||
title: "不能为空",
|
||||
type: "error",
|
||||
});
|
||||
} else {
|
||||
this.form.businessAddress = this.form.residenceAddress;
|
||||
getMon(this.form).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.$refs.uToast.show({
|
||||
title: "提交成功",
|
||||
type: "success",
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: "/pages/tabbar/user/my",
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onUploaded(lists) {
|
||||
console.log(lists); // 打印上传成功后的文件列表
|
||||
lists.forEach((item) => {
|
||||
this.form.businessLicense = item.response.result;
|
||||
});
|
||||
},
|
||||
onUploadedtwo(lists) {
|
||||
let images = [];
|
||||
lists.forEach((item) => {
|
||||
images.push(item.response.result);
|
||||
});
|
||||
this.form.idPhoto = images;
|
||||
},
|
||||
changetime(value) {
|
||||
console.log(value); // 打印选择的日期
|
||||
this.form.idExpiryDate = value.result; // 将选择的日期赋值给form.idExpiryDate
|
||||
},
|
||||
// 选中某个复选框时,由checkbox时触发
|
||||
checkboxChange(e) {
|
||||
console.log(e, "[====]");
|
||||
},
|
||||
// 选中任一checkbox时,由checkbox-group触发
|
||||
checkboxGroupChange(e) {
|
||||
this.form.businessScope = e;
|
||||
},
|
||||
|
||||
getCategoryList() {
|
||||
getCategoryList(0).then((res) => {
|
||||
res.data.result.forEach((item) => {
|
||||
item.checked = false; // 初始化每个项目的checked属性为false
|
||||
});
|
||||
this.cateList = res.data.result;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep {
|
||||
.u-form-item--left__content {
|
||||
width: 100px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.u-input {
|
||||
margin-left: 30px; // 可根据实际情况调整这个值
|
||||
}
|
||||
.u-checkbox__icon-wrap--checked{
|
||||
border-color: #fe3c3c !important;
|
||||
background-color: #fe3c3c !important;
|
||||
}
|
||||
}
|
||||
.bunem {
|
||||
width: 309px;
|
||||
margin-top: 20px;
|
||||
height: 41px;
|
||||
font-size: 15px;
|
||||
line-height: 41px;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
margin-bottom: 35px;
|
||||
}
|
||||
</style>
|
149
pages/mine/invite.vue
Normal file
@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<div class="sigin">
|
||||
<div class="tui">
|
||||
<div class="cnent">
|
||||
<!-- <div><img :src="ImageUrl" alt="" width="60" class="round-avatar"></div> -->
|
||||
<div class="tuijianm">
|
||||
<div :style="{ fontsize: '24px' }">您的专属推荐码</div>
|
||||
<div :style="{ marginTop: '10px' }">{{ resfn }}</div>
|
||||
</div>
|
||||
<div class="qian">
|
||||
<h3>奖励说明:</h3>
|
||||
<div>将邀请码分享给他人绑定成功且参与开店获得更多奖励</div>
|
||||
</div>
|
||||
<button class="btn" @click="share">分享</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottomc">
|
||||
<!-- <button class="btn">立即推荐</button>
|
||||
<button class="btn">保存海报</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mymon } from "@/api/point.js";
|
||||
// import { saveImageToPhotosAlbum } from "@/utils/request.js"; // 假设该方法在 request.js 中
|
||||
import config from "@/config/config.js"; // 假设 config.js 中定义了 API 接口地址
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
resfn: "",
|
||||
ImageUrl: "",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getmy();
|
||||
},
|
||||
methods: {
|
||||
getmy() {
|
||||
mymon().then((res) => {
|
||||
this.resfn = res.data.result.code;
|
||||
// this.ImageUrl= res.data.result.face;
|
||||
});
|
||||
},
|
||||
share() {
|
||||
console.log(config.downloadLink);
|
||||
|
||||
// 这里添加第三方分享逻辑
|
||||
uni.showActionSheet({
|
||||
itemList: ['分享到微信好友', '分享到朋友圈', '分享到QQ', '分享到消息'],
|
||||
success: (res) => {
|
||||
const providerMap = ['weixin', 'weixin', 'qq', 'im'];
|
||||
const sceneMap = ['WXSceneSession', 'WXSceneTimeline', '', ''];
|
||||
// 分享到微信好友、朋友圈或QQ ------------暂定
|
||||
|
||||
if (providerMap[res.tapIndex] === 'im') {
|
||||
uni.setClipboardData({
|
||||
data:`邀请码:${this.resfn}`,
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: "复制成功",
|
||||
icon: "none"
|
||||
});
|
||||
uni.switchTab({
|
||||
url: "/pages/tabbar/im/index",
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({
|
||||
title: "复制失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.share({
|
||||
provider: providerMap[res.tapIndex],
|
||||
scene: sceneMap[res.tapIndex],
|
||||
title: '无终街邀请专属码',
|
||||
summary: '输入达人邀请码,获得更多曝光量',
|
||||
imageUrl: '/static/imlogo.png',
|
||||
href:config.downloadLink,
|
||||
success: () => uni.showToast({ title: '分享成功' })
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.sigin {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: url("@/static/abcx.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.tui {
|
||||
padding: 0px;
|
||||
height: calc(85vh - 65px);
|
||||
width: 80%;
|
||||
margin: 10px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.cnent {
|
||||
height: 80%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.round-avatar {
|
||||
border-radius: 50%;
|
||||
object-fit: cover; /* 确保图片填充整个圆形区域 */
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
.bottomc {
|
||||
width: 80%;
|
||||
height: 15vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.qian {
|
||||
width: 80%;
|
||||
|
||||
margin-top: 50px;
|
||||
}
|
||||
.btn {
|
||||
width: 75%;
|
||||
background: #fe3c3c;
|
||||
margin-top: 56px;
|
||||
}
|
||||
.tuijianm {
|
||||
width: 65%;
|
||||
height: 5.3vh;
|
||||
font-size: 20px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
margin-top: 24vh;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
91
pages/mine/inviteinput.vue
Normal file
@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<div class="sigin">
|
||||
<div class="cal">输入邀请码获取特定礼包</div>
|
||||
<div class="si_input">
|
||||
<u-input
|
||||
v-model="inviteCode"
|
||||
type="text"
|
||||
aria-placeholder="
|
||||
请输入推荐码"
|
||||
/>
|
||||
</div>
|
||||
<div class="si_bottom">
|
||||
<button class="btn" @click="head">绑定推荐码</button>
|
||||
</div>
|
||||
<u-toast ref="uToast" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { inviteCode } from "@/api/point.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
resfn: "",
|
||||
ImageUrl: "",
|
||||
inviteCode: "",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// this.getmy();
|
||||
},
|
||||
methods: {
|
||||
head() {
|
||||
if (this.inviteCode == "") {
|
||||
this.$refs.uToast.show({
|
||||
title: "请输入邀请码",
|
||||
type: "error",
|
||||
});
|
||||
} else {
|
||||
inviteCode(this.inviteCode).then((res) => {
|
||||
console.log(res);
|
||||
if (res.data.code == 200) {
|
||||
this.$refs.uToast.show({
|
||||
title: "绑定成功",
|
||||
type: "success",
|
||||
});
|
||||
// this.$message.success('');
|
||||
// this.$router.push({ path: "/home" });
|
||||
} else {
|
||||
this.$message.error(res.data.message);
|
||||
this.$refs.uToast.show({
|
||||
title: res.data.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// return false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.sigin {
|
||||
width: 100%;
|
||||
height: 25vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
.si_input {
|
||||
width: 70%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
.si_bottom {
|
||||
width: 70%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
.cal {
|
||||
width: 70%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
}
|
||||
.btn {
|
||||
background: #fe3c3c;
|
||||
}
|
||||
</style>
|
0
pages/mine/makeMoney/index.sass
Normal file
30
pages/mine/makeMoney/index.vue
Normal file
@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
84654
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPointsData } from "@/api/members.js";
|
||||
import { getMemberPointSum } from "@/api/members.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
|
@ -16,7 +16,7 @@
|
||||
@change="changeChecked(item)"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
|
||||
<image :src="item.thumbnail"></image>
|
||||
<image :src="imgfun(item.thumbnail)"></image>
|
||||
</view>
|
||||
<view class="myTracks-item-content" @click.stop="navgaiteToDetail(item)">
|
||||
<view class="myTracks-item-title">
|
||||
|
269
pages/mine/mydistribution/index.vue
Normal file
@ -0,0 +1,269 @@
|
||||
<template>
|
||||
<div class="distribution-container">
|
||||
<!-- Header section -->
|
||||
<div class="distribution-header">
|
||||
<div class="total-earnings">
|
||||
<div class="total">
|
||||
<h2 :style="{ fontSize: '15px' }">总收益(元)</h2>
|
||||
<h2 :style="{ fontSize: '15px' }" @click="show = true">
|
||||
<u-icon name="question-circle" color="#fff" size="28"></u-icon>
|
||||
提现规则
|
||||
</h2>
|
||||
</div>
|
||||
<p class="amount" :style="{ fontSize: '30px' }">1164</p>
|
||||
</div>
|
||||
<div class="hr"></div>
|
||||
<div class="withdrawable" :style="{ padding: '10px 0px' }">
|
||||
<div class="itox">可提现金额:<span class="amount">94.26元</span></div>
|
||||
<div class="buto" @click="goToDepositPage">提现</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Main content card -->
|
||||
<div class="distribution-card">
|
||||
<!-- Stats grid -->
|
||||
<div class="stats-grid">
|
||||
<h2>当月数据</h2>
|
||||
<div class="stats-row">
|
||||
<div class="stat-item">
|
||||
<div class="stat-value">197</div>
|
||||
<div class="stat-label">我的邀请</div>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<div class="stat-value">100.00</div>
|
||||
<div class="stat-label">现金奖励</div>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<div class="stat-value">200.00</div>
|
||||
<div class="stat-label">待入账</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 新增的菜单列表 -->
|
||||
<div class="menu-list">
|
||||
<div class="menu-item" v-for="(item, index) in menuItems" :key="index" @click="touni(item.url)">
|
||||
<div class="menu-text">{{ item.name }}</div>
|
||||
<u-icon name="arrow-right" color="#999" size="16"></u-icon>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Withdrawal Rules Popup -->
|
||||
<u-popup
|
||||
v-model="show"
|
||||
mode="right"
|
||||
border-radius="14"
|
||||
width="500rpx"
|
||||
height="100%"
|
||||
>
|
||||
<view class="rules-popup">
|
||||
<div class="rules-header">
|
||||
<h1>提现规则</h1>
|
||||
</div>
|
||||
<div class="rules-content">
|
||||
<ol class="rules-list">
|
||||
<li class="rule-item">
|
||||
每次可提现10%的现金额度到余额账户,手续费从提现金额里扣除8%。
|
||||
</li>
|
||||
<li class="rule-item">提现后8~7天内到账</li>
|
||||
<li class="rule-item">每个用户同时只能发起1笔提现订单</li>
|
||||
</ol>
|
||||
</div>
|
||||
</view>
|
||||
</u-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "MyDistribution",
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
menuItems: [
|
||||
{name:"我的用户",url:''},
|
||||
{name:"消费记录",url:''},
|
||||
{name:"收益明细",url:''},
|
||||
{name:"提现记录",url:''},
|
||||
{name:"我的邀请码",url:'/pages/mine/invite'},
|
||||
]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
touni(e){
|
||||
uni.navigateTo({ url:e });
|
||||
},
|
||||
goToDepositPage() {
|
||||
uni.navigateTo({ url: '/pages/mine/deposit/operation' });
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.menu-list {
|
||||
background-color: white;
|
||||
border-radius: 8px;
|
||||
margin: 15px;
|
||||
padding: 0 15px;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
|
||||
.menu-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 15px 0;
|
||||
border-bottom: 1px solid #f5f5f5;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.menu-text {
|
||||
font-size: 15px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.u-icon {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.hr {
|
||||
width: 100%;
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.distribution-container {
|
||||
font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
|
||||
width: 100%;
|
||||
color: #333;
|
||||
|
||||
.distribution-header {
|
||||
background-color: #ff7d00;
|
||||
color: white;
|
||||
padding: 25px 20px;
|
||||
|
||||
.total-earnings {
|
||||
margin-bottom: 15px;
|
||||
|
||||
.total {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.withdrawable {
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.buto {
|
||||
padding: 4px 12px;
|
||||
border: 1px solid #fff;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.itox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.amount {
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
margin-left: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.distribution-card {
|
||||
background-color: white;
|
||||
border-radius: 8px;
|
||||
margin: -25px 15px 20px;
|
||||
padding: 20px;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
|
||||
h2 {
|
||||
font-size: 16px;
|
||||
margin: 0 0 15px 0;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.stats-grid {
|
||||
h2 {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.stats-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.stat-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
|
||||
.stat-value {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Withdrawal Rules Popup Styles */
|
||||
.rules-popup {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #ff7d00;
|
||||
.rules-header {
|
||||
color: white;
|
||||
padding: 15px 20px;
|
||||
|
||||
h1 {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.rules-content {
|
||||
background-color: #ff7d00;
|
||||
flex: 1;
|
||||
color: white;
|
||||
padding: 20px;
|
||||
// background-color: #fff;
|
||||
overflow-y: auto;
|
||||
|
||||
.rules-list {
|
||||
padding-left: 20px;
|
||||
margin: 0;
|
||||
|
||||
.rule-item {
|
||||
margin-bottom: 15px;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
// color: #333;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
323
pages/mine/openShop/ThirdApply.vue
Normal file
@ -0,0 +1,323 @@
|
||||
<template>
|
||||
<div class="person-msg">
|
||||
<u-form ref="thirdForm" :model="form" :rules="rules" :label-width="200">
|
||||
<h4>基础信息</h4>
|
||||
<u-form-item prop="storeName" label="店铺名称">
|
||||
<u-input
|
||||
type="text"
|
||||
v-model="form.storeName"
|
||||
placeholder="请填写店铺名称"
|
||||
/>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item prop="storeLogo" label="店铺logo">
|
||||
<!-- <Upload
|
||||
ref="uploadLogo"
|
||||
:show-upload-list="false"
|
||||
:on-success="handleSuccess"
|
||||
:format="['jpg', 'jpeg', 'png', 'gif']"
|
||||
:max-size="2048"
|
||||
:before-upload="beforeUpload"
|
||||
:on-format-error="handleFormatError"
|
||||
:on-exceeded-size="handleMaxSize"
|
||||
:on-error="uploadErr"
|
||||
multiple
|
||||
:action="action"
|
||||
:headers="accessToken"
|
||||
>
|
||||
<Button type="info" :loading="uploadLoading">上传logo</Button>
|
||||
</Upload> -->
|
||||
|
||||
<u-upload
|
||||
:header="{ accessToken: storage.getAccessToken() }"
|
||||
max-count="1"
|
||||
:action="action"
|
||||
@on-uploaded="onUploadedtwo"
|
||||
style="margin-left: 30px"
|
||||
></u-upload>
|
||||
<div class="describe">请压缩图片在2M以内,格式为gif,jpg,png</div>
|
||||
</u-form-item>
|
||||
<u-form-item prop="goodsManagementCategory" label="店铺经营类目">
|
||||
<u-checkbox-group
|
||||
@change="checkboxGroupChange"
|
||||
style="margin-left: 30px"
|
||||
>
|
||||
<u-checkbox
|
||||
v-model="item.checked"
|
||||
v-for="(item, index) in cateList"
|
||||
:key="index"
|
||||
:name="item.id"
|
||||
>{{ item.name }}</u-checkbox
|
||||
>
|
||||
</u-checkbox-group>
|
||||
</u-form-item>
|
||||
<u-form-item prop="storeCenter" label="店铺所在地">
|
||||
<u-input
|
||||
v-model="form.___path"
|
||||
type="select"
|
||||
@click="showPicker"
|
||||
placeholder="请选择所在地区"
|
||||
/>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item prop="storeAddressDetail" label="店铺详细地址">
|
||||
<u-input
|
||||
type="text"
|
||||
v-model="form.storeAddressDetail"
|
||||
placeholder="请填写店铺详细地址"
|
||||
/>
|
||||
</u-form-item>
|
||||
<u-form-item prop="storeDesc" label="店铺简介">
|
||||
<u-input
|
||||
type="textarea"
|
||||
v-model="form.storeDesc"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
:rows="4"
|
||||
placeholder="请输入店铺简介"
|
||||
/>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item>
|
||||
<!-- <button @click="uni.navigateBack()" :style="{background:'#F50505'}">返回</button> -->
|
||||
<button
|
||||
type="primary"
|
||||
:style="{ background: '#FE3C3C' }"
|
||||
@click="next"
|
||||
class="bunem"
|
||||
>
|
||||
提交平台审核
|
||||
</button>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<!-- <Modal title="View Image" v-model="visible">
|
||||
<img :src="previewPicture" v-if="visible" style="width: 100%" />
|
||||
</Modal> -->
|
||||
<!-- <lili-map ref="liliMap" @getAddress="getAddress" :useApi="false"></lili-map> -->
|
||||
<m-city
|
||||
:provinceData="list"
|
||||
headTitle="区域选择"
|
||||
ref="cityPicker"
|
||||
@funcValue="getpickerParentValue"
|
||||
pickerSize="4"
|
||||
></m-city>
|
||||
<u-toast ref="uToast" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import storage from "@/utils/storage.js";
|
||||
import { upload } from "@/api/common.js";
|
||||
import { applyThird } from "@/api/goods";
|
||||
import gkcity from "@/components/m-city/m-city.vue";
|
||||
import { getCategoryList, getMon } from "@/api/goods.js";
|
||||
export default {
|
||||
components: {
|
||||
"m-city": gkcity,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cateList: [],
|
||||
list: [
|
||||
{
|
||||
id: "",
|
||||
localName: "请选择",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
storage: storage,
|
||||
loading: false, // 加载状态
|
||||
uploadLoading: false, // 上传加载状态
|
||||
action: upload, // 上传地址
|
||||
accessToken: {}, // 验证token
|
||||
previewPicture: "", // 预览图片
|
||||
address: "", // 回显地址
|
||||
visible: false, // 图片预览
|
||||
form: {
|
||||
// 表单数据
|
||||
storeLogo: [],
|
||||
},
|
||||
rules: {
|
||||
// 验证规则
|
||||
goodsManagementCategory: [
|
||||
{ required: true, message: "请选择店铺经营类目" },
|
||||
],
|
||||
storeName: [{ required: true, message: "请填写店铺名称" }],
|
||||
storeLogo: [{ required: true, message: "请上传店铺logo" }],
|
||||
storeDesc: [{ required: true, message: "请填写店铺简介" }],
|
||||
storeCenter: [{ required: true, message: "请选择店铺位置" }],
|
||||
storeAddressIdPath: [{ required: true, message: "请选择店铺位置" }],
|
||||
storeAddressDetail: [{ required: true, message: "请输入店铺详细地址" }],
|
||||
},
|
||||
categoryList: [], // 分类数据
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
checkboxGroupChange(e) {
|
||||
this.form.goodsManagementCategory = e;
|
||||
this.form.goodsManagementCategory =
|
||||
this.form.goodsManagementCategory.join(",");
|
||||
console.log(this.form);
|
||||
},
|
||||
getCategoryList() {
|
||||
getCategoryList(0).then((res) => {
|
||||
res.data.result.forEach((item) => {
|
||||
item.checked = false; // 初始化每个项目的checked属性为false
|
||||
});
|
||||
this.cateList = res.data.result;
|
||||
});
|
||||
},
|
||||
showPicker() {
|
||||
this.$refs.cityPicker.show();
|
||||
},
|
||||
// 三级地址联动回调
|
||||
getpickerParentValue(e) {
|
||||
// 将需要绑定的地址设置为空,并赋值
|
||||
this.form.storeAddressIdPath = [];
|
||||
this.form.storeAddressPath = [];
|
||||
let name = "";
|
||||
|
||||
e.forEach((item, index) => {
|
||||
if (item.id) {
|
||||
// 遍历数据
|
||||
this.form.storeAddressIdPath.push(item.id);
|
||||
this.form.storeAddressPath.push(item.localName);
|
||||
name += item.localName;
|
||||
this.form.___path = name;
|
||||
}
|
||||
if (index == e.length - 1) {
|
||||
//如果是最后一个
|
||||
let _town = item.children.filter((_child) => {
|
||||
return _child.id == item.id;
|
||||
});
|
||||
this.$set(
|
||||
this.form,
|
||||
"storeCenter",
|
||||
_town[0].center.split(",")[0] + "," + _town[0].center.split(",")[1]
|
||||
);
|
||||
this.form.storeAddressIdPath = this.form.storeAddressIdPath.join(",");
|
||||
this.form.storeAddressPath = this.form.storeAddressPath.join(",");
|
||||
}
|
||||
});
|
||||
console.log(this.form);
|
||||
},
|
||||
|
||||
// 店铺logo
|
||||
onUploadedtwo(lists) {
|
||||
lists.forEach((item) => {
|
||||
this.form.storeLogo.push(item.response.result);
|
||||
});
|
||||
},
|
||||
// 下一步
|
||||
next() {
|
||||
this.$refs.thirdForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
let params = JSON.parse(JSON.stringify(this.form));
|
||||
params.storeLogo = this.form.storeLogo.toString();
|
||||
params.goodsManagementCategory =
|
||||
this.form.goodsManagementCategory.toString();
|
||||
|
||||
applyThird(params)
|
||||
.then((res) => {
|
||||
this.loading = false;
|
||||
uni.showToast({
|
||||
title: "请正确输入",
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: "/pages/tabbar/user/my",
|
||||
});
|
||||
}, 1000);
|
||||
})
|
||||
.catch(() => {
|
||||
uni.showToast({
|
||||
title: "请正确输入",
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
});
|
||||
this.loading = false;
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "请正确输入",
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
});
|
||||
console.log("error");
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getCategoryList();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.person-msg {
|
||||
padding: 10px;
|
||||
}
|
||||
h4 {
|
||||
margin-bottom: 10px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #f8f8f8;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
}
|
||||
.ivu-input-wrapper {
|
||||
width: 300px;
|
||||
}
|
||||
.img-list {
|
||||
display: inline-block;
|
||||
margin: 10px;
|
||||
width: 100px;
|
||||
height: auto;
|
||||
position: relative;
|
||||
.cover {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
width: inherit;
|
||||
height: inherit;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
i {
|
||||
color: #fff;
|
||||
font-size: 30px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
&:hover .cover {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
.describe {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
.bunem {
|
||||
width: 309px;
|
||||
margin-top: 50px;
|
||||
height: 41px;
|
||||
font-size: 15px;
|
||||
line-height: 41px;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
}
|
||||
::v-deep {
|
||||
.u-checkbox__icon-wrap--checked {
|
||||
border-color: #fe3c3c !important;
|
||||
background-color: #fe3c3c !important;
|
||||
}
|
||||
}
|
||||
</style>
|
431
pages/mine/openShop/index.vue
Normal file
@ -0,0 +1,431 @@
|
||||
<template>
|
||||
<view style="padding: 10px">
|
||||
<u-form :model="form" ref="firstForm" :rules="rules">
|
||||
<h4>企业资质信息</h4>
|
||||
<u-form-item prop="companyName" label="公司名称">
|
||||
<u-input v-model="form.companyName" placeholder="请填写公司信息" />
|
||||
</u-form-item>
|
||||
<u-form-item prop="companyAddressIdPath" label="公司所在地">
|
||||
<u-input
|
||||
v-model="path"
|
||||
type="select"
|
||||
@click="showPicker"
|
||||
placeholder="请选择所在地区"
|
||||
/>
|
||||
</u-form-item>
|
||||
<u-form-item prop="companyAddress" label="详细地址">
|
||||
<u-input
|
||||
v-model="form.companyAddress"
|
||||
placeholder="请填写公司详细信息"
|
||||
/>
|
||||
</u-form-item>
|
||||
<u-form-item prop="employeeNum" label="员工总数">
|
||||
<u-input v-model="form.employeeNum" placeholder="请填写公司员工总数"
|
||||
><span slot="append">人</span>
|
||||
</u-input>
|
||||
</u-form-item>
|
||||
<u-form-item prop="companyPhone" label="公司电话">
|
||||
<u-input
|
||||
v-model="form.companyPhone"
|
||||
placeholder="请填写公司电话"
|
||||
></u-input>
|
||||
</u-form-item>
|
||||
<u-form-item prop="registeredCapital" label="注册资金">
|
||||
<u-input
|
||||
v-model="form.registeredCapital"
|
||||
placeholder="请填写注册资金(万元)"
|
||||
>
|
||||
<!-- <span slot="append">万元</span> -->
|
||||
</u-input>
|
||||
</u-form-item>
|
||||
<u-form-item prop="linkName" label="联系人姓名">
|
||||
<u-input v-model="form.linkName" placeholder="请填写联系人姓名" />
|
||||
</u-form-item>
|
||||
<u-form-item prop="linkPhone" label="联系人电话">
|
||||
<u-input v-model="form.linkPhone" placeholder="请填写联系人电话" />
|
||||
</u-form-item>
|
||||
<u-form-item prop="companyEmail" label="电子邮箱">
|
||||
<u-input v-model="form.companyEmail" placeholder="请填写电子邮箱" />
|
||||
</u-form-item>
|
||||
<h4>营业执照信息</h4>
|
||||
<u-form-item prop="licenseNum" label="营业执照号">
|
||||
<u-input v-model="form.licenseNum" placeholder="请填写营业执照号" />
|
||||
</u-form-item>
|
||||
<u-form-item prop="scope" label="经营范围">
|
||||
<u-input
|
||||
type="textarea"
|
||||
v-model="form.scope"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
:rows="4"
|
||||
placeholder="请输入营业执照所示经营范围"
|
||||
/>
|
||||
</u-form-item>
|
||||
<u-form-item prop="licencePhoto" label="营业执照电子版">
|
||||
<u-upload
|
||||
:action="action"
|
||||
:header="{ accessToken: storage.getAccessToken() }"
|
||||
max-count="1"
|
||||
style="margin-left: 70px"
|
||||
@on-uploaded="onUploadedone"
|
||||
></u-upload>
|
||||
</u-form-item>
|
||||
<h4>法人信息</h4>
|
||||
<u-form-item prop="legalName" label="法人姓名">
|
||||
<u-input
|
||||
v-model="form.legalName"
|
||||
maxlength="20"
|
||||
placeholder="请输入法人姓名"
|
||||
/>
|
||||
</u-form-item>
|
||||
<u-form-item prop="legalId" label="法人证件号">
|
||||
<u-input v-model="form.legalId" placeholder="请输入法人证件号" />
|
||||
</u-form-item>
|
||||
<u-form-item prop="legalPhoto" label="法人证件电子版">
|
||||
<u-upload
|
||||
:header="{ accessToken: storage.getAccessToken() }"
|
||||
max-count="2"
|
||||
:action="action"
|
||||
@on-uploaded="onUploadedtwo"
|
||||
style="margin-left: 70px"
|
||||
></u-upload>
|
||||
<div class="describe">
|
||||
请压缩图片在2M以内,身份证正反面两张照片,确保图片清晰无缺角
|
||||
</div>
|
||||
</u-form-item>
|
||||
<u-form-item> </u-form-item>
|
||||
</u-form>
|
||||
<button
|
||||
type="primary"
|
||||
@click="next"
|
||||
:style="{ background: '#FE3C3C' }"
|
||||
class="bunem"
|
||||
>
|
||||
填写财务资质信息
|
||||
</button>
|
||||
<u-toast ref="uToast" />
|
||||
<m-city
|
||||
:provinceData="list"
|
||||
headTitle="区域选择"
|
||||
ref="cityPicker"
|
||||
@funcValue="getpickerParentValue"
|
||||
pickerSize="4"
|
||||
>
|
||||
</m-city>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import storage from "@/utils/storage.js";
|
||||
import { upload } from "@/api/common.js";
|
||||
import gkcity from "@/components/m-city/m-city.vue";
|
||||
import { applyFirst } from "@/api/goods";
|
||||
import * as RegExp from "@/plugins/Reg/RegExp.js";
|
||||
export default {
|
||||
components: {
|
||||
"m-city": gkcity,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: [
|
||||
{
|
||||
id: "",
|
||||
localName: "请选择",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
action: upload,
|
||||
storage: storage,
|
||||
path: "",
|
||||
form: {
|
||||
legalPhoto: [],
|
||||
licencePhoto: [],
|
||||
|
||||
legalId: "",
|
||||
legalName: "",
|
||||
companyName: "",
|
||||
// companyAddressIdPath: "",
|
||||
companyAddress: "",
|
||||
employeeNum: "",
|
||||
registeredCapital: "",
|
||||
companyAddressPath: "",
|
||||
linkName: "",
|
||||
},
|
||||
rules: {
|
||||
companyName: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写公司信息",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
companyAddressIdPath: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择公司所在地",
|
||||
trigger: ["change"],
|
||||
},
|
||||
],
|
||||
companyAddress: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写公司详细地址",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
employeeNum: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写公司员工总数",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
{
|
||||
pattern: RegExp.integer,
|
||||
message: "只能填写正整数",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
registeredCapital: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写公司注册资金",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
{
|
||||
pattern: RegExp.integer,
|
||||
message: "只能填写正整数",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
linkName: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写联系人姓名",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
linkPhone: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写联系人电话",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
{
|
||||
pattern: RegExp.mobile,
|
||||
message: "请填写正确的号码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
companyPhone: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写公司电话",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
{
|
||||
pattern: RegExp.TEL,
|
||||
message: "请填写正确的号码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
companyEmail: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写电子邮箱",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
{
|
||||
type: "email",
|
||||
message: "请输入正确的邮箱",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
licenseNum: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写营业执照号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
{
|
||||
pattern: RegExp.licenseNum,
|
||||
message: "请输入正确的营业执照号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
scope: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写营业执照所示经营范围",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
legalPhoto: [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传法人身份证照片",
|
||||
trigger: ["change"],
|
||||
},
|
||||
],
|
||||
licencePhoto: [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传营业执照",
|
||||
trigger: ["change"],
|
||||
},
|
||||
],
|
||||
legalName: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入法人姓名",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
legalId: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入法人证件号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
{
|
||||
pattern: RegExp.IDCard,
|
||||
message: "请输入正确的证件号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
// 页面加载时可以初始化数据
|
||||
},
|
||||
onShow() {
|
||||
// 页面显示时可以执行一些操作
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
// 显示三级地址联动
|
||||
showPicker() {
|
||||
this.$refs.cityPicker.show();
|
||||
},
|
||||
// 三级地址联动回调
|
||||
getpickerParentValue(e) {
|
||||
// 将需要绑定的地址设置为空,并赋值
|
||||
this.form.consigneeAddressIdPath = [];
|
||||
this.form.consigneeAddressPath = [];
|
||||
let name = "";
|
||||
|
||||
e.forEach((item, index) => {
|
||||
if (item.id) {
|
||||
// 遍历数据
|
||||
this.form.consigneeAddressIdPath.push(item.id);
|
||||
this.form.consigneeAddressPath.push(item.localName);
|
||||
name += item.localName;
|
||||
this.form.companyAddressPath = name;
|
||||
this.path = name;
|
||||
}
|
||||
if (index == e.length - 1) {
|
||||
//如果是最后一个
|
||||
let _town = item.children.filter((_child) => {
|
||||
return _child.id == item.id;
|
||||
});
|
||||
|
||||
this.form.lat = _town[0].center.split(",")[1];
|
||||
this.form.lon = _town[0].center.split(",")[0];
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
consub() {},
|
||||
|
||||
onUploaded(lists) {
|
||||
lists.forEach((item) => {
|
||||
this.form.businessLicense = item.response.result;
|
||||
});
|
||||
},
|
||||
// 法人证件电子
|
||||
onUploadedone(lists) {
|
||||
lists.forEach((item) => {
|
||||
this.form.licencePhoto = item.response.result;
|
||||
});
|
||||
},
|
||||
// 法人证件电子版
|
||||
onUploadedtwo(lists) {
|
||||
lists.forEach((item) => {
|
||||
this.form.legalPhoto.push(item.response.result);
|
||||
});
|
||||
},
|
||||
|
||||
// 下一步
|
||||
next() {
|
||||
this.$refs.firstForm.validate((valid) => {
|
||||
if (valid) {
|
||||
let params = JSON.parse(JSON.stringify(this.form));
|
||||
params.legalPhoto = this.form.legalPhoto.toString();
|
||||
params.licencePhoto = this.form.licencePhoto.toString();
|
||||
if (
|
||||
this.form.legalPhoto != "" &&
|
||||
this.form.legalId != "" &&
|
||||
this.form.legalName != ""
|
||||
) {
|
||||
applyFirst(params)
|
||||
.then((res) => {
|
||||
if (res.data.success) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/mine/openShop/secon",
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "请正确输入",
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
uni.showToast({
|
||||
title: "请正确输入",
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
});
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "请正确输入",
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: "表单校验失败,请检查输入内容",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep {
|
||||
.u-form-item--left__content {
|
||||
width: 100px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.bunem {
|
||||
width: 309px;
|
||||
margin-top: 20px;
|
||||
height: 41px;
|
||||
font-size: 15px;
|
||||
line-height: 41px;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
margin-bottom: 35px;
|
||||
}
|
||||
.u-input {
|
||||
margin-left: 30px; // 可根据实际情况调整这个值
|
||||
}
|
||||
}
|
||||
</style>
|
189
pages/mine/openShop/secon.vue
Normal file
@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<div class="photo-msg">
|
||||
<u-form ref="secondForm" :model="form" :rules="rules" :label-width="250">
|
||||
<h4>财务资质信息</h4>
|
||||
<u-form-item prop="settlementBankAccountName" label="银行开户名">
|
||||
<u-input
|
||||
type="text"
|
||||
v-model="form.settlementBankAccountName"
|
||||
placeholder="请填写银行开户名称"
|
||||
/>
|
||||
</u-form-item>
|
||||
<u-form-item prop="settlementBankAccountNum" label="银行账号">
|
||||
<u-input
|
||||
type="text"
|
||||
v-model="form.settlementBankAccountNum"
|
||||
placeholder="请填写银行账号"
|
||||
/>
|
||||
</u-form-item>
|
||||
<u-form-item prop="settlementBankBranchName" label="开户银行支行名称">
|
||||
<u-input
|
||||
type="text"
|
||||
v-model="form.settlementBankBranchName"
|
||||
placeholder="请填写开户银行支行名称"
|
||||
/>
|
||||
</u-form-item>
|
||||
<u-form-item prop="settlementBankJointName" label="支行联行号">
|
||||
<u-input
|
||||
type="text"
|
||||
v-model="form.settlementBankJointName"
|
||||
placeholder="请填写支行联行号"
|
||||
/>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item>
|
||||
<!-- <button @click="uni.navigateBack()" :style="{background:'#F50505'}">返回</button> -->
|
||||
<button type="primary" @click="next" :style="{ background: '#FE3C3C' }" class="bunem">
|
||||
填写其他信息
|
||||
</button>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { applySecond } from "@/api/goods";
|
||||
export default {
|
||||
// props: {
|
||||
// content: {
|
||||
// default: {},
|
||||
// type: Object,
|
||||
// },
|
||||
// },
|
||||
data() {
|
||||
return {
|
||||
loading: false, // 加载状态
|
||||
form: {}, // 表单数据
|
||||
rules: {
|
||||
// 验证规则
|
||||
settlementBankAccountName: [
|
||||
{ required: true, message: "请填写银行开户名称", trigger: "blur" },
|
||||
{
|
||||
min: 2,
|
||||
max: 20,
|
||||
message: "长度在 2 到 20 个字符",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
settlementBankAccountNum: [
|
||||
{ required: true, message: "请填写银行账号", trigger: "blur" },
|
||||
{
|
||||
pattern: /^\d{16,19}$/,
|
||||
message: "请输入 16 到 19 位的银行账号",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
settlementBankBranchName: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写开户银行支行名称",
|
||||
trigger: "blur",
|
||||
},
|
||||
{
|
||||
min: 4,
|
||||
max: 50,
|
||||
message: "长度在 4 到 50 个字符",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
settlementBankJointName: [
|
||||
{ required: true, message: "请填写支行联行号", trigger: "blur" },
|
||||
{
|
||||
pattern: /^\d{12}$/,
|
||||
message: "请输入 12 位的支行联行号",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
ngm() {
|
||||
uni.navigateBack({
|
||||
delta: 1, // 返回上一级页面
|
||||
});
|
||||
},
|
||||
// 下一步
|
||||
next() {
|
||||
this.$refs.secondForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
if (this.form.settlementBankJointName != "") {
|
||||
applySecond(this.form)
|
||||
.then((res) => {
|
||||
if (res.data.success) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/mine/openShop/ThirdApply",
|
||||
});
|
||||
|
||||
}else {
|
||||
uni.showToast({
|
||||
title: "请正确输入",
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
uni.showToast({
|
||||
title: "请正确输入",
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
});
|
||||
});
|
||||
} else {
|
||||
console.log("error");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// if (this.content != {}) {
|
||||
// this.form = JSON.parse(JSON.stringify(this.content));
|
||||
// this.$forceUpdate();
|
||||
// }
|
||||
// this.$refs.secondForm.resetFields();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
h4 {
|
||||
margin-bottom: 10px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #f8f8f8;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
}
|
||||
.ivu-input-wrapper {
|
||||
width: 300px;
|
||||
}
|
||||
.photo-msg {
|
||||
padding: 20px;
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
}
|
||||
::v-deep {
|
||||
// .u-form-item--left__content {
|
||||
// width: 100px;
|
||||
// white-space: nowrap;
|
||||
// }
|
||||
.bunem{
|
||||
width: 309px;
|
||||
margin-top: 50px;
|
||||
height: 41px;
|
||||
font-size: 15px;
|
||||
line-height: 41px;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
}
|
||||
.u-input {
|
||||
margin-left: 30px; // 可根据实际情况调整这个值
|
||||
}
|
||||
}
|
||||
</style>
|
@ -2,36 +2,68 @@
|
||||
<div class="feedBack">
|
||||
<div class="feedBack-box">
|
||||
<h4>猜你想问</h4>
|
||||
<div class="feedBack-item" :class="{'active':feedBack.type == item.value }" @click="handleClick(index)" v-for="(item,index) in list" :key="index">
|
||||
{{item.text}}
|
||||
<div
|
||||
class="feedBack-item"
|
||||
:class="{ active: feedBack.type == item.value }"
|
||||
@click="handleClick(index)"
|
||||
v-for="(item, index) in list"
|
||||
:key="index"
|
||||
>
|
||||
{{ item.text }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="feedBack-box">
|
||||
<h4>问题反馈 <span style="margin-left:10rpx;" v-if="feedBack.type">@{{ list.find(item=>{return item.value == feedBack.type }).text }}</span></h4>
|
||||
<u-input class="field-input" height="500" :border-bottom="false" v-model="feedBack.context" type="textarea" placeholder="请输入反馈信息">
|
||||
<h4>
|
||||
问题反馈
|
||||
<span style="margin-left: 10rpx" v-if="feedBack.type"
|
||||
>@{{
|
||||
list.find((item) => {
|
||||
return item.value == feedBack.type;
|
||||
}).text
|
||||
}}</span
|
||||
>
|
||||
</h4>
|
||||
<u-input
|
||||
class="field-input"
|
||||
height="500"
|
||||
:border-bottom="false"
|
||||
v-model="feedBack.context"
|
||||
type="textarea"
|
||||
placeholder="请输入反馈信息"
|
||||
>
|
||||
</u-input>
|
||||
</div>
|
||||
|
||||
<!-- 上传凭证 -->
|
||||
<div class="feedBack-box">
|
||||
<view class="opt-view">
|
||||
<view class="img-title">上传凭证(最多5张)</view>
|
||||
<view class="img-title">上传凭证(最多1张)</view>
|
||||
<view class="images-view">
|
||||
<u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150" @on-uploaded="onUploaded" :max-count="5" :show-progress="false"></u-upload>
|
||||
<u-upload
|
||||
:header="{ accessToken: storage.getAccessToken() }"
|
||||
:action="action"
|
||||
width="150"
|
||||
@on-uploaded="onUploaded"
|
||||
:max-count="1"
|
||||
:show-progress="false"
|
||||
></u-upload>
|
||||
</view>
|
||||
</view>
|
||||
</div>
|
||||
|
||||
<div class="feedBack-box">
|
||||
<h4>手机号</h4>
|
||||
<u-input :border-bottom="false" v-model="feedBack.mobile" placeholder="请输入您的手机号">
|
||||
<u-input
|
||||
:border-bottom="false"
|
||||
v-model="feedBack.mobile"
|
||||
placeholder="请输入您的手机号"
|
||||
>
|
||||
</u-input>
|
||||
</div>
|
||||
|
||||
<div class="submit" @click="submit()">提交</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -130,7 +162,7 @@ export default {
|
||||
margin: 0 auto;
|
||||
border-radius: 100px;
|
||||
}
|
||||
.active{
|
||||
.active {
|
||||
color: $light-color !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
@ -1,277 +1,320 @@
|
||||
<template>
|
||||
<view class="person-msg">
|
||||
<view class="head c-content" @click="changeFace">
|
||||
<image :src="form.face || '/static/missing-face.png'" mode=""></image>
|
||||
<view>点击修改头像</view>
|
||||
</view>
|
||||
<u-form :model="form" ref="uForm" class="form">
|
||||
<u-form-item label="昵称" label-width="150">
|
||||
<u-input v-model="form.nickName" placeholder="请输入昵称" />
|
||||
</u-form-item>
|
||||
<u-form-item label="性别" label-width="150">
|
||||
<u-radio-group v-model="form.sex" :active-color="lightColor">
|
||||
<u-radio name="1">男</u-radio>
|
||||
<u-radio name="0">女</u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<view class="person-msg">
|
||||
<view class="head c-content" @click="changeFace">
|
||||
<image :src="form.face || '/static/missing-face.png'" mode=""></image>
|
||||
<view>点击修改头像</view>
|
||||
</view>
|
||||
<u-form :model="form" ref="uForm" class="form">
|
||||
<u-form-item label="昵称" label-width="150">
|
||||
<u-input
|
||||
v-model="form.nickName"
|
||||
placeholder="请输入昵称"
|
||||
maxlength="10"
|
||||
/>
|
||||
</u-form-item>
|
||||
<u-form-item label="二维码" label-width="150">
|
||||
<img :src="erwei" alt="" width="60" @click="showQrCodeInFullSize" />
|
||||
</u-form-item>
|
||||
<u-form-item label="性别" label-width="150">
|
||||
<u-radio-group v-model="form.sex" :active-color="lightColor">
|
||||
<u-radio name="1">男</u-radio>
|
||||
<u-radio name="0">女</u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item label="生日" label-width="150" right-icon="arrow-right">
|
||||
<div style="width: 100%" @click="showBirthday = true">
|
||||
{{ birthday || "请选择出生日期" }}
|
||||
</div>
|
||||
<u-picker
|
||||
v-model="showBirthday"
|
||||
mode="time"
|
||||
:confirm-color="lightColor"
|
||||
@confirm="selectTime"
|
||||
></u-picker>
|
||||
</u-form-item>
|
||||
|
||||
|
||||
|
||||
<u-form-item label="生日" label-width="150" right-icon="arrow-right">
|
||||
<div style="width: 100%;" @click="showBirthday = true">{{ birthday || '请选择出生日期' }}</div>
|
||||
<u-picker v-model="showBirthday" mode="time" :confirm-color="lightColor"
|
||||
@confirm="selectTime"></u-picker>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="城市" label-width="150" placeholder="请选择城市" right-icon="arrow-right">
|
||||
<div style="width: 100%;" @click="clickRegion">{{ form.___path || '请选择城市' }}</div>
|
||||
</u-form-item>
|
||||
|
||||
</u-form>
|
||||
<div class="bottom">
|
||||
<view class="submit" @click="submit">保存</view>
|
||||
<view class="submit light" @click="showModalDialog">退出登录</view>
|
||||
</div>
|
||||
<u-modal show-cancel-button v-model="quitShow" @confirm="confirm" :confirm-color="lightColor" :async-close="true"
|
||||
:content="userInfo.id ? '确定要退出登录么?' : '确定要返回登录么?'"></u-modal>
|
||||
<m-city :provinceData="region" headTitle="区域选择" ref="cityPicker" @funcValue="getpickerParentValue"
|
||||
pickerSize="4"></m-city>
|
||||
</view>
|
||||
<u-form-item
|
||||
label="城市"
|
||||
label-width="150"
|
||||
placeholder="请选择城市"
|
||||
right-icon="arrow-right"
|
||||
>
|
||||
<div style="width: 100%" @click="clickRegion">
|
||||
{{ form.___path || "请选择城市" }}
|
||||
</div>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<div style="display: flex; justify-content: center"></div>
|
||||
<div class="bottom">
|
||||
<view class="submit" @click="submit">保存</view>
|
||||
<view class="submit light" @click="showModalDialog">退出登录</view>
|
||||
</div>
|
||||
<u-modal
|
||||
show-cancel-button
|
||||
v-model="quitShow"
|
||||
@confirm="confirm"
|
||||
:confirm-color="lightColor"
|
||||
:async-close="true"
|
||||
:content="userInfo.id ? '确定要退出登录么?' : '确定要返回登录么?'"
|
||||
></u-modal>
|
||||
<m-city
|
||||
:provinceData="region"
|
||||
headTitle="区域选择"
|
||||
ref="cityPicker"
|
||||
@funcValue="getpickerParentValue"
|
||||
pickerSize="4"
|
||||
></m-city>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
saveUserInfo
|
||||
} from "@/api/members.js";
|
||||
import {
|
||||
upload
|
||||
} from "@/api/common.js";
|
||||
import { logout } from "@/api/login";
|
||||
import storage from "@/utils/storage.js";
|
||||
import uFormItem from "@/uview-ui/components/u-form-item/u-form-item.vue";
|
||||
import gkcity from "@/components/m-city/m-city.vue";
|
||||
export default {
|
||||
components: {
|
||||
uFormItem,
|
||||
"m-city": gkcity
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
quitShow:false,
|
||||
userInfo:{},
|
||||
lightColor: this.$lightColor, //高亮颜色
|
||||
form: {
|
||||
nickName: storage.getUserInfo().nickName || "",
|
||||
birthday: storage.getUserInfo().birthday || "",
|
||||
face: storage.getUserInfo().face || "/static/missing-face.png", //默认头像
|
||||
regionId: [], //地址Id
|
||||
region: storage.getUserInfo().region || [], //地址
|
||||
sex: storage.getUserInfo().sex, //性别
|
||||
___path: storage.getUserInfo().region,
|
||||
},
|
||||
birthday: storage.getUserInfo().birthday || "", //生日
|
||||
photo: [{
|
||||
text: "立即拍照",
|
||||
color: this.$mainColor
|
||||
},
|
||||
{
|
||||
text: "从相册选择",
|
||||
color: this.$mainColor
|
||||
},
|
||||
],
|
||||
region: [
|
||||
//请求城市默认地址
|
||||
{
|
||||
id: "",
|
||||
localName: "请选择",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
showBirthday: false, //显示生日日期
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
console.log('personMSg')
|
||||
this.userInfo = this.$options.filters.isLogin();
|
||||
console.log(this.userInfo)
|
||||
},
|
||||
methods: {
|
||||
showModalDialog() {
|
||||
this.quitShow = true;
|
||||
},
|
||||
clear() {
|
||||
storage.setAccessToken("");
|
||||
storage.setRefreshToken("");
|
||||
storage.setUserInfo({});
|
||||
// 清理vlog信息
|
||||
storage.setVlogToken("")
|
||||
storage.setVlogUserInfo({})
|
||||
this.$options.filters.navigateToLogin("redirectTo");
|
||||
},
|
||||
/**
|
||||
* 确认退出
|
||||
* 清除缓存重新登录
|
||||
*/
|
||||
async confirm() {
|
||||
await logout();
|
||||
this.clear();
|
||||
},
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
quiteLoginOut() {
|
||||
console.log(this.$options)
|
||||
this.$options.filters.quiteLoginOut();
|
||||
},
|
||||
/**
|
||||
* 选择地址回调
|
||||
*/
|
||||
getpickerParentValue(e) {
|
||||
this.form.region = [];
|
||||
this.form.regionId = [];
|
||||
let name = "";
|
||||
import { saveUserInfo, geterwei } from "@/api/members.js";
|
||||
import { upload } from "@/api/common.js";
|
||||
import { logout } from "@/api/login";
|
||||
import storage from "@/utils/storage.js";
|
||||
import uFormItem from "@/uview-ui/components/u-form-item/u-form-item.vue";
|
||||
import gkcity from "@/components/m-city/m-city.vue";
|
||||
export default {
|
||||
components: {
|
||||
uFormItem,
|
||||
"m-city": gkcity,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
erwei: "",
|
||||
quitShow: false,
|
||||
userInfo: {},
|
||||
lightColor: this.$lightColor, //高亮颜色
|
||||
form: {
|
||||
nickName: storage.getUserInfo().nickName || "",
|
||||
birthday: storage.getUserInfo().birthday || "",
|
||||
face: storage.getUserInfo().face || "/static/missing-face.png", //默认头像
|
||||
regionId: [], //地址Id
|
||||
region: storage.getUserInfo().region || [], //地址
|
||||
sex: storage.getUserInfo().sex, //性别
|
||||
___path: storage.getUserInfo().region,
|
||||
},
|
||||
birthday: storage.getUserInfo().birthday || "", //生日
|
||||
photo: [
|
||||
{
|
||||
text: "立即拍照",
|
||||
color: this.$mainColor,
|
||||
},
|
||||
{
|
||||
text: "从相册选择",
|
||||
color: this.$mainColor,
|
||||
},
|
||||
],
|
||||
region: [
|
||||
//请求城市默认地址
|
||||
{
|
||||
id: "",
|
||||
localName: "请选择",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
showBirthday: false, //显示生日日期
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.userInfo = this.$options.filters.isLogin();
|
||||
this.getgeterwei();
|
||||
},
|
||||
methods: {
|
||||
showQrCodeInFullSize() {
|
||||
uni.previewImage({
|
||||
urls: [this.erwei],
|
||||
current: this.erwei,
|
||||
});
|
||||
},
|
||||
getgeterwei() {
|
||||
geterwei().then((res) => {
|
||||
this.erwei = res.data.result;
|
||||
});
|
||||
},
|
||||
showModalDialog() {
|
||||
this.quitShow = true;
|
||||
},
|
||||
clear() {
|
||||
storage.setAccessToken("");
|
||||
storage.setRefreshToken("");
|
||||
storage.setUserInfo({});
|
||||
// 清理vlog信息
|
||||
storage.setVlogToken("");
|
||||
storage.setVlogUserInfo({});
|
||||
this.$options.filters.navigateToLogin("redirectTo");
|
||||
},
|
||||
/**
|
||||
* 确认退出
|
||||
* 清除缓存重新登录
|
||||
*/
|
||||
async confirm() {
|
||||
await logout();
|
||||
this.clear();
|
||||
},
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
quiteLoginOut() {
|
||||
this.$options.filters.quiteLoginOut();
|
||||
},
|
||||
/**
|
||||
* 选择地址回调
|
||||
*/
|
||||
getpickerParentValue(e) {
|
||||
this.form.region = [];
|
||||
this.form.regionId = [];
|
||||
let name = "";
|
||||
|
||||
e.forEach((item, index) => {
|
||||
if (item.id) {
|
||||
this.form.region.push(item.localName);
|
||||
this.form.regionId.push(item.id);
|
||||
if (index == e.length - 1) {
|
||||
name += item.localName;
|
||||
} else {
|
||||
name += item.localName + ",";
|
||||
}
|
||||
this.form.___path = name;
|
||||
}
|
||||
});
|
||||
},
|
||||
e.forEach((item, index) => {
|
||||
if (item.id) {
|
||||
this.form.region.push(item.localName);
|
||||
this.form.regionId.push(item.id);
|
||||
if (index == e.length - 1) {
|
||||
name += item.localName;
|
||||
} else {
|
||||
name += item.localName + ",";
|
||||
}
|
||||
this.form.___path = name;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击选择地址
|
||||
*/
|
||||
clickRegion() {
|
||||
this.$refs.cityPicker.show();
|
||||
},
|
||||
/**
|
||||
* 点击选择地址
|
||||
*/
|
||||
clickRegion() {
|
||||
this.$refs.cityPicker.show();
|
||||
},
|
||||
|
||||
/**
|
||||
* 提交保存
|
||||
*/
|
||||
submit() {
|
||||
delete this.form.___path;
|
||||
let params = JSON.parse(JSON.stringify(this.form));
|
||||
saveUserInfo(params).then((res) => {
|
||||
if (res.statusCode == 200) {
|
||||
storage.setUserInfo(res.data.result);
|
||||
uni.navigateBack();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 提交保存
|
||||
*/
|
||||
submit() {
|
||||
delete this.form.___path;
|
||||
let params = JSON.parse(JSON.stringify(this.form));
|
||||
saveUserInfo(params).then((res) => {
|
||||
if (res.statusCode == 200) {
|
||||
storage.setUserInfo(res.data.result);
|
||||
uni.navigateBack();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改头像
|
||||
*/
|
||||
changeFace(index) {
|
||||
uni.chooseImage({
|
||||
success: (chooseImageRes) => {
|
||||
const tempFilePaths = chooseImageRes.tempFilePaths;
|
||||
uni.uploadFile({
|
||||
url: upload,
|
||||
filePath: tempFilePaths[0],
|
||||
name: "file",
|
||||
header: {
|
||||
accessToken: storage.getAccessToken(),
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
let data = JSON.parse(uploadFileRes.data);
|
||||
console.log(data)
|
||||
this.form.face = data.result;
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 修改头像
|
||||
*/
|
||||
changeFace(index) {
|
||||
uni.chooseImage({
|
||||
success: (chooseImageRes) => {
|
||||
const tempFilePaths = chooseImageRes.tempFilePaths;
|
||||
uni.uploadFile({
|
||||
url: upload,
|
||||
filePath: tempFilePaths[0],
|
||||
name: "file",
|
||||
header: {
|
||||
accessToken: storage.getAccessToken(),
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
let data = JSON.parse(uploadFileRes.data);
|
||||
this.form.face = data.result;
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 选择地址
|
||||
*/
|
||||
selectRegion(region) {
|
||||
this.$set(
|
||||
this.form,
|
||||
"address",
|
||||
`${region.province.label} ${region.city.label} ${region.area.label}`
|
||||
);
|
||||
},
|
||||
/**
|
||||
* 选择地址
|
||||
*/
|
||||
selectRegion(region) {
|
||||
this.$set(
|
||||
this.form,
|
||||
"address",
|
||||
`${region.province.label} ${region.city.label} ${region.area.label}`
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* 选择时间
|
||||
*/
|
||||
selectTime(time) {
|
||||
this.form.birthday = `${time.year}-${time.month}-${time.day}`;
|
||||
this.birthday = `${time.year} - ${time.month} - ${time.day}`;
|
||||
},
|
||||
},
|
||||
/**
|
||||
* 选择时间
|
||||
*/
|
||||
selectTime(time) {
|
||||
this.form.birthday = `${time.year}-${time.month}-${time.day}`;
|
||||
this.birthday = `${time.year} - ${time.month} - ${time.day}`;
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 加载数据
|
||||
*/
|
||||
onLoad() {},
|
||||
};
|
||||
/**
|
||||
* 加载数据
|
||||
*/
|
||||
onLoad() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.submit {
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
margin-top: 90rpx;
|
||||
.submit {
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
margin-top: 90rpx;
|
||||
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
color: $main-color;
|
||||
border-radius: 100px;
|
||||
}
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
color: $main-color;
|
||||
border-radius: 100px;
|
||||
}
|
||||
|
||||
.head {
|
||||
height: 260rpx;
|
||||
color: $font-color-light;
|
||||
font-size: $font-sm;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
line-height: 2em;
|
||||
.head {
|
||||
height: 260rpx;
|
||||
color: $font-color-light;
|
||||
font-size: $font-sm;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
line-height: 2em;
|
||||
|
||||
image {
|
||||
width: 144rpx;
|
||||
height: 144rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
image {
|
||||
width: 144rpx;
|
||||
height: 144rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .u-form {
|
||||
background-color: #ffffff;
|
||||
padding: 0;
|
||||
margin-top: 30rpx;
|
||||
/deep/ .u-form {
|
||||
background-color: #ffffff;
|
||||
padding: 0;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.u-form-item {
|
||||
padding: 0 20rpx;
|
||||
height: 110rpx;
|
||||
line-height: 110rpx;
|
||||
}
|
||||
}
|
||||
.u-form-item {
|
||||
padding: 0 20rpx;
|
||||
height: 110rpx;
|
||||
line-height: 110rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.form {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.bottom{
|
||||
position: fixed;
|
||||
bottom: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
>.submit{
|
||||
background: $light-color;
|
||||
color: #fff;
|
||||
width: 40%;
|
||||
}
|
||||
.form {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.bottom {
|
||||
position: fixed;
|
||||
bottom: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
> .submit {
|
||||
background: $light-color;
|
||||
background: #fe3c3c;
|
||||
color: #fff;
|
||||
width: 40%;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
::v-deep {
|
||||
.u-radio__icon-wrap--checked {
|
||||
// background: #FE3C3C;
|
||||
// border: 1px solid #FE3C3C;
|
||||
border-color: #fe3c3c !important;
|
||||
background-color: #fe3c3c !important;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -4,9 +4,15 @@
|
||||
<div class="box">
|
||||
<div class="circle-box">
|
||||
<div class="cricle" @click="signIn()">
|
||||
<span v-if="!ifSign" :class="{ active: signFlag || ifSign }">签到</span>
|
||||
<span v-else :class="{ active: signFlag || ifSign }"
|
||||
:style="ifSign ? 'transform: rotateY(0deg);' : ''">已签</span>
|
||||
<span v-if="!ifSign" :class="{ active: signFlag || ifSign }"
|
||||
>签到</span
|
||||
>
|
||||
<span
|
||||
v-else
|
||||
:class="{ active: signFlag || ifSign }"
|
||||
:style="ifSign ? 'transform: rotateY(0deg);' : ''"
|
||||
>已签</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<text class="tips">坚持每天连续签到可以获多重奖励哦</text>
|
||||
@ -16,28 +22,46 @@
|
||||
<view class="date-con">
|
||||
<view class="date-tit">
|
||||
<div class="current-month">
|
||||
<div class="day">每日记录<span> ({{ currentMonth }})</span></div>
|
||||
<div class="day">
|
||||
每日记录<span> ({{ currentMonth }})</span>
|
||||
</div>
|
||||
</div>
|
||||
</view>
|
||||
<view class="week">
|
||||
<text v-for="item in weekArr" :key="item.id">{{ item }}</text>
|
||||
</view>
|
||||
<view class="date" v-for="obj in dataObj" :key="obj.id">
|
||||
<view class="item" v-for="item in obj" :key="item.id" :class="item == '' ? 'hide' : ''"
|
||||
:animation="item == currentDay ? animationData : ''">
|
||||
<view class="just" :class="signArr.indexOf(item) != -1 ? 'active' : ''">
|
||||
<view
|
||||
class="item"
|
||||
v-for="item in obj"
|
||||
:key="item.id"
|
||||
:class="item == '' ? 'hide' : ''"
|
||||
:animation="item == currentDay ? animationData : ''"
|
||||
>
|
||||
<view
|
||||
class="just"
|
||||
:class="signArr.indexOf(item) != -1 ? 'active' : ''"
|
||||
>
|
||||
<view class="top">{{ item }} </view>
|
||||
<view class="bottom">
|
||||
<u-icon name="error" v-if="item <= currentDay" color="#999"></u-icon>
|
||||
<u-icon
|
||||
name="error"
|
||||
v-if="item <= currentDay"
|
||||
color="#999"
|
||||
></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="back" :class="signArr.indexOf(item) != -1 ? 'active' : ''" :style="
|
||||
<view
|
||||
class="back"
|
||||
:class="signArr.indexOf(item) != -1 ? 'active' : ''"
|
||||
:style="
|
||||
signArr.indexOf(item) != -1 && ifSign
|
||||
? 'transform: rotateY(0deg);'
|
||||
: signArr.indexOf(item) != -1 && item != currentDay
|
||||
? 'transform: rotateY(0deg);'
|
||||
: ''
|
||||
">
|
||||
"
|
||||
>
|
||||
<view class="top">{{ item }}</view>
|
||||
<view class="bottom">
|
||||
<u-icon name="checkmark" :color="aiderLightColor"></u-icon>
|
||||
@ -54,7 +78,12 @@
|
||||
<text class="close" @click="close">×</text>
|
||||
</view>
|
||||
<view class="mask-con">
|
||||
<u-icon size="120" style="margin: 50rpx 0" :color="aiderLightColor" name="checkmark"></u-icon>
|
||||
<u-icon
|
||||
size="120"
|
||||
style="margin: 50rpx 0"
|
||||
:color="aiderLightColor"
|
||||
name="checkmark"
|
||||
></u-icon>
|
||||
<text class="text">连续签到可获得额外奖励哦!</text>
|
||||
</view>
|
||||
</view>
|
||||
@ -66,7 +95,7 @@ import { sign, signTime } from "@/api/point.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
aiderLightColor:this.$aiderLightColor,
|
||||
aiderLightColor: this.$aiderLightColor,
|
||||
signFlag: false,
|
||||
animationData: {},
|
||||
maskFlag: false, //
|
||||
@ -293,6 +322,11 @@ page {
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep {
|
||||
.u-icon__icon{
|
||||
color: #fe3c3c !important;
|
||||
}
|
||||
}
|
||||
.date-card {
|
||||
padding: 0 32rpx;
|
||||
margin: 32rpx 0;
|
||||
@ -309,12 +343,11 @@ page {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
border-radius: 50%;
|
||||
background: $aider-light-color;
|
||||
box-shadow: 0 4rpx 24rpx 0 rgba($color: $aider-light-color, $alpha: 1);
|
||||
background: #fe3c3c;
|
||||
box-shadow: 0 4rpx 24rpx 0 #fe3c3c;
|
||||
display: flex;
|
||||
justify-content: center; //这个是X轴居中
|
||||
align-items: center; //这个是 Y轴居中
|
||||
|
||||
}
|
||||
|
||||
.cricle {
|
||||
@ -335,7 +368,7 @@ page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding:64rpx 32rpx;
|
||||
padding: 64rpx 32rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@
|
||||
<div v-for="(item, index) in goodsList" :key="index" class="goods-row">
|
||||
<div class="flex goods-col">
|
||||
<div class="goods-img" @click="navigateToDetailPage(item)">
|
||||
<u-image width="230rpx" height="230rpx" :src="item.content.thumbnail">
|
||||
<u-image width="230rpx" height="230rpx" :src="imgfun(item.content.thumbnail)">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
</div>
|
||||
@ -151,7 +151,7 @@
|
||||
<view class="goods-list">
|
||||
<view v-for="(item, index) in goodsList" :key="index" class="goods-item">
|
||||
<view class="image-wrapper" @click="navigateToDetailPage(item)">
|
||||
<image :src="item.content.thumbnail" mode="aspectFill"></image>
|
||||
<image :src="imgfun(item.content.thumbnail)" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="goods-detail">
|
||||
<div class="title clamp" @click="navigateToDetailPage(item)">{{ item.content.goodsName }}</div>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<view v-for="(sku, _index) in order.orderItems" :key="_index">
|
||||
<view class="goods-item-view">
|
||||
<view>
|
||||
<u-image border-radius="6rpx" width="132rpx" height="132rpx" class="goods_img" :src="sku.image"
|
||||
<u-image border-radius="6rpx" width="132rpx" height="132rpx" class="goods_img" :src="imgfun(sku.image)"
|
||||
alt />
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
|
@ -307,6 +307,8 @@ import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
|
||||
|
||||
export default {
|
||||
onLoad: function (val) {
|
||||
console.log(val,'======');
|
||||
|
||||
this.routerVal = val;
|
||||
},
|
||||
components: {
|
||||
|
BIN
pages/passport/static/logn.png
Normal file
After Width: | Height: | Size: 22 KiB |
@ -16,6 +16,8 @@
|
||||
},
|
||||
onLoad (e) {
|
||||
const params = JSON.parse((decodeURIComponent(e.params)))
|
||||
console.log(params,'=============');
|
||||
|
||||
chat.init({
|
||||
sign: params.mpSign, //必传,公司渠道唯一标识,腾讯云智服后台系统创建「小程序插件」渠道后,在「渠道管理」获取
|
||||
token: params.token, //非必填
|
||||
|
@ -18,6 +18,7 @@
|
||||
"
|
||||
:thumbnail="goodsDetail.thumbnail"
|
||||
:goodsName="goodsDetail.goodsName"
|
||||
:price="goodsDetail.goodsName"
|
||||
type="goods"
|
||||
@close="shareFlage = false"
|
||||
/>
|
||||
@ -38,7 +39,11 @@
|
||||
>
|
||||
<div class="headerRow">
|
||||
<div class="backs">
|
||||
<u-icon @click="back()" name="arrow-left" class="icon-back"></u-icon>
|
||||
<u-icon
|
||||
@click="back()"
|
||||
name="arrow-left"
|
||||
class="icon-back"
|
||||
></u-icon>
|
||||
|
||||
<u-icon
|
||||
name="list"
|
||||
@ -46,7 +51,10 @@
|
||||
class="icon-list"
|
||||
></u-icon>
|
||||
</div>
|
||||
<div class="headerList" :class="headerFlag ? 'tab-bar' : 'tab-bar scroll-hide'">
|
||||
<div
|
||||
class="headerList"
|
||||
:class="headerFlag ? 'tab-bar' : 'tab-bar scroll-hide'"
|
||||
>
|
||||
<div class="headerRow">
|
||||
<div
|
||||
class="nav-item"
|
||||
@ -143,7 +151,10 @@
|
||||
<view>
|
||||
<view class="-goods-flex">
|
||||
<!-- 如果有积分显示积分 -->
|
||||
<view class="-goods-price" v-if="goodsDetail.price != undefined">
|
||||
<view
|
||||
class="-goods-price"
|
||||
v-if="goodsDetail.price != undefined"
|
||||
>
|
||||
<span v-if="pointDetail.points">
|
||||
<span class="price">{{ pointDetail.points }}</span>
|
||||
<span>积分</span>
|
||||
@ -151,7 +162,9 @@
|
||||
|
||||
<span v-else>
|
||||
<span>¥</span
|
||||
><span class="price">{{ formatPrice(goodsDetail.price)[0] }}</span
|
||||
><span class="price">{{
|
||||
formatPrice(goodsDetail.price)[0]
|
||||
}}</span
|
||||
>.{{ formatPrice(goodsDetail.price)[1] }}
|
||||
</span>
|
||||
</view>
|
||||
@ -169,9 +182,10 @@
|
||||
:color="favorite ? '#f2270c' : '#262626'"
|
||||
:name="favorite ? 'heart-fill' : 'heart'"
|
||||
></u-icon>
|
||||
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{
|
||||
favorite ? "已收藏" : "收藏"
|
||||
}}</view>
|
||||
<view
|
||||
:style="{ color: favorite ? '#f2270c' : '#262626' }"
|
||||
>{{ favorite ? "已收藏" : "收藏" }}</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<view class="-goods-name desc-bold">
|
||||
@ -188,8 +202,14 @@
|
||||
<view class="card-flex" @click="shutMask(1)">
|
||||
<view class="card-title"> 促销 </view>
|
||||
<view class="card-content">
|
||||
<span v-if="PromotionList && emptyPromotion()">暂无促销信息</span>
|
||||
<PromotionLayout v-else @shutMasks="shutMask" :res="PromotionList" />
|
||||
<span v-if="PromotionList && emptyPromotion()"
|
||||
>暂无促销信息</span
|
||||
>
|
||||
<PromotionLayout
|
||||
v-else
|
||||
@shutMasks="shutMask"
|
||||
:res="PromotionList"
|
||||
/>
|
||||
</view>
|
||||
<view class="card-bottom">
|
||||
<u-icon name="more-dot-fill"></u-icon>
|
||||
@ -205,7 +225,10 @@
|
||||
/>
|
||||
|
||||
<!-- 配置地址 如果是虚拟产品的时候不展示 -->
|
||||
<view class="card-box" v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'">
|
||||
<view
|
||||
class="card-box"
|
||||
v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'"
|
||||
>
|
||||
<view class="card-flex" @click="shutMask(4)">
|
||||
<view class="card-title"> 已选 </view>
|
||||
<view class="card-content">
|
||||
@ -220,14 +243,25 @@
|
||||
<u-icon name="more-dot-fill"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-flex" @click="shutMask(3)">
|
||||
<view class="card-flex" @click="shutMask(3)" v-if="ste==1">
|
||||
<view class="card-title"> 送至</view>
|
||||
<view class="card-content">
|
||||
<view class="card-content" >
|
||||
<span v-if="delivery">{{
|
||||
delivery.consigneeAddressPath | clearStrComma
|
||||
}}</span>
|
||||
<span v-else>暂无地址信息</span>
|
||||
</view>
|
||||
|
||||
<view class="card-bottom">
|
||||
<u-icon name="more-dot-fill"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-flex" v-else>
|
||||
<view class="card-title"> 店铺位置</view>
|
||||
<view class="card-content" >
|
||||
{{ addren }}
|
||||
</view>
|
||||
|
||||
<view class="card-bottom">
|
||||
<u-icon name="more-dot-fill"></u-icon>
|
||||
</view>
|
||||
@ -245,14 +279,14 @@
|
||||
:res="recommendList"
|
||||
/>
|
||||
|
||||
<!-- 宝贝详情 -->
|
||||
<!-- 宝贝详情
|
||||
<GoodsIntro
|
||||
id="main9"
|
||||
:res="goodsDetail"
|
||||
:goodsParams="goodsParams"
|
||||
:goodsId="goodsDetail.goodsId"
|
||||
v-if="goodsDetail.id"
|
||||
/>
|
||||
/> -->
|
||||
|
||||
<!-- 宝贝推荐 -->
|
||||
<GoodsRecommend id="main11" :res="likeGoodsList" />
|
||||
@ -261,7 +295,10 @@
|
||||
|
||||
<view class="page-bottom mp-iphonex-bottom" id="pageBottom">
|
||||
<view class="icon-btn">
|
||||
<view class="icon-btn-item" @click="navigateToStore(goodsDetail.storeId)">
|
||||
<view
|
||||
class="icon-btn-item"
|
||||
@click="navigateToStore(goodsDetail.storeId)"
|
||||
>
|
||||
<u-icon size="34" class="red" name="home-fill"></u-icon>
|
||||
<view class="red icon-btn-name">店铺</view>
|
||||
</view>
|
||||
@ -279,17 +316,24 @@
|
||||
<view class="detail-btn" v-if="!isGroup">
|
||||
<view
|
||||
class="to-store-car to-store-btn"
|
||||
v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'"
|
||||
v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS' && ste==1 "
|
||||
@click="shutMask(4)"
|
||||
>
|
||||
加入购物车</view
|
||||
>
|
||||
<view class="to-buy to-store-btn" @click="shutMask(4, 'buy')">立即购买</view>
|
||||
<view class="to-store-car to-store-btn" v-if="startTimer">暂未开始</view>
|
||||
<view class="to-buy to-store-btn" @click="shutMask(4, 'buy')"
|
||||
>立即购买</view
|
||||
>
|
||||
<view class="to-store-car to-store-btn" v-if="startTimer"
|
||||
>暂未开始</view
|
||||
>
|
||||
</view>
|
||||
<!-- 拼团结算 -->
|
||||
<view class="detail-btn" v-else>
|
||||
<view class="to-store-car pt-buy to-store-btn" @click="shutMask(4, 'buy')">
|
||||
<view
|
||||
class="to-store-car pt-buy to-store-btn"
|
||||
@click="shutMask(4, 'buy')"
|
||||
>
|
||||
<view>¥{{ goodsDetail.price | unitPrice }}</view>
|
||||
<view>单独购买</view>
|
||||
</view>
|
||||
@ -358,7 +402,12 @@
|
||||
|
||||
<script>
|
||||
/************接口API***************/
|
||||
import { getGoods, getGoodsList, getMpScene, getGoodsDistribution } from "@/api/goods.js";
|
||||
import {
|
||||
getGoods,
|
||||
getGoodsList,
|
||||
getMpScene,
|
||||
getGoodsDistribution,
|
||||
} from "@/api/goods.js";
|
||||
import * as API_trade from "@/api/trade.js";
|
||||
import * as API_Members from "@/api/members.js";
|
||||
import * as API_store from "@/api/store.js";
|
||||
@ -382,8 +431,11 @@ import popupGoods from "@/components/m-buy/goods"; //购物车商品的模块
|
||||
import popupAddress from "./product/popup/address"; //地址选择模块
|
||||
import shares from "@/components/m-share/index"; //分享
|
||||
import popups from "@/components/popups/popups"; //气泡框
|
||||
|
||||
import { TUILogin } from "@tencentcloud/tui-core";
|
||||
import { TUIChatKit } from "@/TUIKit";
|
||||
import { getUserimInfo } from "@/api/members";
|
||||
import setup from "./product/popup/popup";
|
||||
TUIChatKit.init();
|
||||
export default {
|
||||
components: {
|
||||
popups,
|
||||
@ -400,9 +452,11 @@ export default {
|
||||
GoodsSwiper,
|
||||
popupGoods,
|
||||
popupAddress,
|
||||
TUIChatKit
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addren:"",
|
||||
setup,
|
||||
promotionShow: false, //弹窗开关
|
||||
promotionFlag: true, //活动开关
|
||||
@ -524,6 +578,7 @@ export default {
|
||||
|
||||
routerVal: "",
|
||||
IMLink: "", // IM地址
|
||||
ste:1
|
||||
};
|
||||
},
|
||||
|
||||
@ -549,6 +604,7 @@ export default {
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.ste=uni.getStorageSync('ste')
|
||||
const { windowHeight } = uni.getSystemInfoSync();
|
||||
let bottomHeight = 0;
|
||||
let topHeight = 0;
|
||||
@ -599,7 +655,11 @@ export default {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.init(this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId);
|
||||
this.init(
|
||||
this.routerVal.id,
|
||||
this.routerVal.goodsId,
|
||||
this.routerVal.distributionId
|
||||
);
|
||||
}
|
||||
},
|
||||
// #ifdef MP-WEIXIN
|
||||
@ -661,6 +721,8 @@ export default {
|
||||
}
|
||||
/**商品信息以及规格信息存储 */
|
||||
this.goodsDetail = response.data.result.data;
|
||||
this.addren= response.data.result.storeAddressPath;
|
||||
|
||||
this.goodsSpec = response.data.result.specs;
|
||||
this.PromotionList = response.data.result.promotionMap;
|
||||
this.goodsParams = response.data.result.goodsParamsDTOList || [];
|
||||
@ -697,7 +759,7 @@ export default {
|
||||
this.getGoodsCollectionFun(this.goodsDetail.id);
|
||||
}
|
||||
// 获取IM 需要的话使用
|
||||
// this.getIMDetailMethods();
|
||||
this.getIMDetailMethods();
|
||||
},
|
||||
|
||||
async getIMDetailMethods() {
|
||||
@ -708,6 +770,38 @@ export default {
|
||||
},
|
||||
|
||||
linkMsgDetail() {
|
||||
// storage.getUserInfo
|
||||
getUserimInfo()
|
||||
.then(({ data }) => {
|
||||
if (data.success ) {
|
||||
const par = data.result;
|
||||
TUILogin.login({
|
||||
SDKAppID: par.sdkAppId,
|
||||
userID: par.userID,
|
||||
userSig: par.userSig,
|
||||
useUploadPlugin: true, // If you need to send rich media messages, please set to true.
|
||||
framework: `vue2`, // framework used vue2 / vue3
|
||||
}).then(() => {
|
||||
const conversationID = `C2C${this.goodsDetail.createBy}`;
|
||||
uni.navigateTo({
|
||||
url: `/TUIKit/components/TUIChat/index?conversationID=${conversationID}`,
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// 接口返回非 200 状态码,跳转登录页面
|
||||
uni.navigateTo({
|
||||
url: "/pages/passport/login",
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
// 请求失败,跳转登录页面
|
||||
uni.navigateTo({
|
||||
url: "/pages/passport/login",
|
||||
});
|
||||
});
|
||||
|
||||
return;
|
||||
if (this.storeDetail.merchantEuid) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/tabbar/home/web-view?src=${this.IM}`,
|
||||
@ -748,6 +842,7 @@ export default {
|
||||
if (typeof val == "undefined") {
|
||||
return val;
|
||||
}
|
||||
|
||||
return val.toFixed(2).split(".");
|
||||
},
|
||||
|
||||
@ -880,6 +975,7 @@ export default {
|
||||
keyword: this.goodsDetail.name,
|
||||
}).then((res) => {
|
||||
this.likeGoodsList = res.data.result.content;
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
:fade="true"
|
||||
duration="450"
|
||||
:lazy-load="true"
|
||||
:src="item.content.thumbnail"
|
||||
:src="imgfun(item.content.thumbnail)"
|
||||
width="330rpx"
|
||||
height="330rpx"
|
||||
class="like-goods-uimage"
|
||||
@ -40,6 +40,9 @@
|
||||
<script>
|
||||
export default {
|
||||
props: ["res"],
|
||||
mounted() {
|
||||
console.log(this.res);
|
||||
},
|
||||
methods: {
|
||||
// 点击店铺推荐
|
||||
clickGoods(val) {
|
||||
|
@ -3,7 +3,12 @@
|
||||
<!-- 商店信息 -->
|
||||
<view class="store-info">
|
||||
<view class="logo">
|
||||
<u-image width="120rpx" mode="aspectFit" height="120rpx" :src="storeDetail.storeLogo"></u-image>
|
||||
<u-image
|
||||
width="120rpx"
|
||||
mode="aspectFit"
|
||||
height="120rpx"
|
||||
:src="storeDetail.storeLogo"
|
||||
></u-image>
|
||||
</view>
|
||||
<view class="name-star star-con">
|
||||
<div class="name">
|
||||
@ -11,7 +16,9 @@
|
||||
<span v-if="storeDetail.selfOperated == 1" class="shopTag">自营</span>
|
||||
</div>
|
||||
<div class="store-row">
|
||||
<div class="collectionNum">{{ storeDetail.collectionNum || 0 }}人关注</div>
|
||||
<div class="collectionNum">
|
||||
{{ storeDetail.collectionNum || 0 }}人关注
|
||||
</div>
|
||||
<div class="goodsNum">{{ storeDetail.goodsNum || 0 }}件商品</div>
|
||||
</div>
|
||||
</view>
|
||||
@ -23,16 +30,31 @@
|
||||
<view class="store-recommend">
|
||||
<view class="store-recommend-title">商品推荐</view>
|
||||
<view class="recommend-list">
|
||||
<view class="recommend-item" @click="clickGoods(item)" v-for="(item, index) in res" :key="index">
|
||||
<u-image class="recommend-item-img" :fade="true" duration="450" :lazy-load="true" :src="item.content.thumbnail" height="218rpx">
|
||||
<view
|
||||
class="recommend-item"
|
||||
@click="clickGoods(item)"
|
||||
v-for="(item, index) in res"
|
||||
:key="index"
|
||||
>
|
||||
<u-image
|
||||
class="recommend-item-img"
|
||||
:fade="true"
|
||||
duration="450"
|
||||
:lazy-load="true"
|
||||
:src="imgfun(item.content.thumbnail)"
|
||||
height="218rpx"
|
||||
>
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<view slot="error" style="font-size: 24rpx; ">加载失败</view>
|
||||
<view slot="error" style="font-size: 24rpx">加载失败</view>
|
||||
</u-image>
|
||||
<view class="recommend-item-name">
|
||||
{{ item.content.goodsName }}
|
||||
</view>
|
||||
<view class="item-price" v-if="item.price != undefined">
|
||||
¥<span class="item-price-blod">{{ formatPrice(item.content.price)[0] }}</span>.{{ formatPrice(item.content.price)[1] }}
|
||||
¥<span class="item-price-blod">{{
|
||||
formatPrice(item.content.price)[0]
|
||||
}}</span
|
||||
>.{{ formatPrice(item.content.price)[1] }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -36,10 +36,11 @@ page {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
> .to-buy {
|
||||
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
||||
background-color: #fe3c3c;
|
||||
|
||||
}
|
||||
> .to-store-car {
|
||||
background-image: linear-gradient(135deg, #f2140c, #f2270c 70%, #f24d0c);
|
||||
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
||||
}
|
||||
> .to-store-btn {
|
||||
flex: 1;
|
||||
|
@ -1,30 +1,49 @@
|
||||
<template>
|
||||
<div>
|
||||
<u-navbar :border-bottom="false">
|
||||
<u-search v-model="keyword" @search="search" @click="search" placeholder="请输入搜索"></u-search>
|
||||
<u-search
|
||||
v-model="keyword"
|
||||
@search="search"
|
||||
@click="search"
|
||||
placeholder="请输入搜索"
|
||||
></u-search>
|
||||
</u-navbar>
|
||||
<div class="wrapper">
|
||||
<!-- 店铺信息模块 -->
|
||||
<div class="store flex">
|
||||
<u-image border-radius="10" width="150" height="150" :src="storeInfo.storeLogo || config.logo" mode="aspectFit">
|
||||
<u-image
|
||||
border-radius="10"
|
||||
width="150"
|
||||
height="150"
|
||||
:src="storeInfo.storeLogo || config.logo"
|
||||
mode="aspectFit"
|
||||
>
|
||||
</u-image>
|
||||
<div class="box">
|
||||
<div class="store-name" @click="getStoreLicencePhoto">
|
||||
{{ storeInfo.storeName || ''}}
|
||||
<u-icon style="margin-left:10rpx;" name="arrow-right"></u-icon>
|
||||
{{ storeInfo.storeName || "" }}
|
||||
<u-icon style="margin-left: 10rpx" name="arrow-right"></u-icon>
|
||||
</div>
|
||||
<div class="flex store-message">
|
||||
<div> <span>{{ storeInfo.collectionNum || 0 }}</span>关注 </div>
|
||||
<div> <span>{{ storeInfo.goodsNum || 0 }}</span>件商品 </div>
|
||||
<div>
|
||||
<span>{{ storeInfo.collectionNum || 0 }}</span
|
||||
>关注
|
||||
</div>
|
||||
<div>
|
||||
<span>{{ storeInfo.goodsNum || 0 }}</span
|
||||
>件商品
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collection">
|
||||
<div class="collection-btn" @click="whetherCollection"> {{ isCollection ? '已关注' : '+ 关注' }}</div>
|
||||
<div class="collection-btn" @click="whetherCollection">
|
||||
{{ isCollection ? "已关注" : "+ 关注" }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 店铺简介 -->
|
||||
<div class="store-desc wes-2">
|
||||
{{storeInfo.storeDesc}}
|
||||
{{ storeInfo.storeDesc }}
|
||||
</div>
|
||||
|
||||
<!-- 联系客服 -->
|
||||
@ -34,19 +53,25 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- 优惠券 -->
|
||||
<scroll-view scroll-x="true" show-scrollbar="false" class="discount" v-if="couponList.length > 0">
|
||||
<scroll-view
|
||||
scroll-x="true"
|
||||
show-scrollbar="false"
|
||||
class="discount"
|
||||
v-if="couponList.length > 0"
|
||||
>
|
||||
<view class="card-box" v-for="(item, index) in couponList" :key="index">
|
||||
<view class="card" @click="getCoupon(item)">
|
||||
<view class="money">
|
||||
<view>
|
||||
<span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}折</span>
|
||||
<span v-if="item.couponType == 'DISCOUNT'"
|
||||
>{{ item.couponDiscount }}折</span
|
||||
>
|
||||
<span v-else>{{ item.price }}元</span>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="xian"></view>
|
||||
<view class="text">
|
||||
<text>{{'领取优惠券'}}</text>
|
||||
<text>{{ "领取优惠券" }}</text>
|
||||
<text>满{{ item.consumeThreshold | unitPrice }}元可用</text>
|
||||
</view>
|
||||
</view>
|
||||
@ -54,14 +79,31 @@
|
||||
</scroll-view>
|
||||
|
||||
<!-- tab -->
|
||||
<u-tabs :list="tabs" :active-color="mainColor" :is-scroll="false" :current="current" @change="changeTab"></u-tabs>
|
||||
<u-tabs
|
||||
:list="tabs"
|
||||
:active-color="mainColor"
|
||||
:is-scroll="false"
|
||||
:current="current"
|
||||
@change="changeTab"
|
||||
></u-tabs>
|
||||
<!-- menu -->
|
||||
|
||||
<!-- 商品 -->
|
||||
<div class="contant" v-if="current == 0">
|
||||
<view v-if="!goodsList.length" class="empty">暂无商品信息</view>
|
||||
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)">
|
||||
<u-image width="100%" height="330rpx" mode="aspectFit" :src="item.content.thumbnail">
|
||||
<view
|
||||
v-else
|
||||
class="item"
|
||||
v-for="(item, index) in goodsList"
|
||||
:key="index"
|
||||
@click="navigateToGoodsDetail(item)"
|
||||
>
|
||||
<u-image
|
||||
width="100%"
|
||||
height="330rpx"
|
||||
mode="aspectFit"
|
||||
:src="imgfun(item.content.thumbnail)"
|
||||
>
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
<div class="name wes-2">{{ item.content.goodsName }}</div>
|
||||
@ -75,16 +117,28 @@
|
||||
</div>
|
||||
<!-- 全部分类 -->
|
||||
<div class="category" v-if="current == 1">
|
||||
<div class="category-item" v-for="(item,index) in categoryList" :key="index">
|
||||
<div
|
||||
class="category-item"
|
||||
v-for="(item, index) in categoryList"
|
||||
:key="index"
|
||||
>
|
||||
<div class="flex" @click="getCategoryGoodsList(item)">
|
||||
<div>{{item.labelName}}</div>
|
||||
<div>{{ item.labelName }}</div>
|
||||
<div>
|
||||
<u-icon color="#999" name="arrow-right"></u-icon>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 分类子级 -->
|
||||
<div class="child-list" v-if="item.children && item.children.length!=0">
|
||||
<div class="child" @click="getCategoryGoodsList(child)" v-for="(child,i) in item.children">{{child.labelName}}
|
||||
<div
|
||||
class="child-list"
|
||||
v-if="item.children && item.children.length != 0"
|
||||
>
|
||||
<div
|
||||
class="child"
|
||||
@click="getCategoryGoodsList(child)"
|
||||
v-for="(child, i) in item.children"
|
||||
>
|
||||
{{ child.labelName }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -101,10 +155,15 @@ import {
|
||||
collectionGoods,
|
||||
getGoodsIsCollect,
|
||||
} from "@/api/members.js";
|
||||
import { TUILogin } from "@tencentcloud/tui-core";
|
||||
import { TUIChatKit } from "@/TUIKit";
|
||||
import { getUserimInfo } from "@/api/members";
|
||||
import config from "@/config/config";
|
||||
import storage from "@/utils/storage";
|
||||
import { getGoodsList } from "@/api/goods.js";
|
||||
import { getAllCoupons } from "@/api/promotions.js";
|
||||
import setup from "./product/popup/popup";
|
||||
TUIChatKit.init();
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -126,7 +185,12 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
current(val) {
|
||||
val == 0 ? ()=>{ this.goodsList = []; this.getGoodsData()} : this.getCategoryData();
|
||||
val == 0
|
||||
? () => {
|
||||
this.goodsList = [];
|
||||
this.getGoodsData();
|
||||
}
|
||||
: this.getCategoryData();
|
||||
},
|
||||
},
|
||||
|
||||
@ -188,30 +252,61 @@ export default {
|
||||
* 联系客服
|
||||
*/
|
||||
linkKefuDetail() {
|
||||
// 客服
|
||||
// #ifdef MP-WEIXIN
|
||||
getUserimInfo()
|
||||
.then(({ data }) => {
|
||||
console.log("data", data);
|
||||
if (data.success) {
|
||||
const par = data.result;
|
||||
TUILogin.login({
|
||||
SDKAppID: par.sdkAppId,
|
||||
userID: par.userID,
|
||||
userSig: par.userSig,
|
||||
useUploadPlugin: true, // If you need to send rich media messages, please set to true.
|
||||
framework: `vue2`, // framework used vue2 / vue3
|
||||
}).then(() => {
|
||||
const conversationID = `C2C${this.storeInfo.memberMobile}`;
|
||||
uni.navigateTo({
|
||||
url: `/TUIKit/components/TUIChat/index?conversationID=${conversationID}`,
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// 接口返回非 200 状态码,跳转登录页面
|
||||
uni.navigateTo({
|
||||
url: "/pages/passport/login",
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("err---------", err);
|
||||
// 请求失败,跳转登录页面
|
||||
uni.navigateTo({
|
||||
url: "/pages/passport/login",
|
||||
});
|
||||
});
|
||||
// // 客服
|
||||
// // #ifdef MP-WEIXIN
|
||||
|
||||
const params = {
|
||||
// originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
||||
uuid: storage.getUuid(),
|
||||
token: storage.getAccessToken(),
|
||||
sign: this.storeInfo.yzfSign,
|
||||
mpSign: this.storeInfo.yzfMpSign,
|
||||
};
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pages/product/customerservice/index?params=" +
|
||||
encodeURIComponent(JSON.stringify(params)),
|
||||
});
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
const sign = this.storeInfo.yzfSign;
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
||||
sign,
|
||||
});
|
||||
// #endif
|
||||
// const params = {
|
||||
// // originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
||||
// uuid: storage.getUuid(),
|
||||
// token: storage.getAccessToken(),
|
||||
// sign: this.storeInfo.yzfSign,
|
||||
// mpSign: this.storeInfo.yzfMpSign,
|
||||
// };
|
||||
// uni.navigateTo({
|
||||
// url:
|
||||
// "/pages/product/customerservice/index?params=" +
|
||||
// encodeURIComponent(JSON.stringify(params)),
|
||||
// });
|
||||
// // #endif
|
||||
// // #ifndef MP-WEIXIN
|
||||
// const sign = this.storeInfo.yzfSign;
|
||||
// uni.navigateTo({
|
||||
// url:
|
||||
// "/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
||||
// sign,
|
||||
// });
|
||||
// // #endif
|
||||
},
|
||||
|
||||
/** 获取店铺分类 */
|
||||
|
@ -5,7 +5,7 @@
|
||||
<div class="contant">
|
||||
<view v-if="!goodsList.length" class="empty">暂无商品信息</view>
|
||||
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)">
|
||||
<u-image width="100%" mode="aspectFit" height="324rpx" :src="item.content.thumbnail">
|
||||
<u-image width="100%" mode="aspectFit" height="324rpx" :src="imgfun(item.content.thumbnail)">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
<div class="name">{{ item.content.goodsName }}</div>
|
||||
|
1154
pages/product/vengoods.vue
Normal file
@ -1,31 +1,50 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<!-- 楼层装修组件 -->
|
||||
<u-navbar class="navbar" :is-back="false" :is-fixed="false">
|
||||
<!-- <u-navbar class="navbar" :is-back="false" :is-fixed="false">
|
||||
<div class="tab-container">
|
||||
<div
|
||||
v-for="(item, index) in list1"
|
||||
:key="index"
|
||||
:class="{ active: currentTabIndex === index }"
|
||||
@click="click(item)"
|
||||
>
|
||||
{{ item.name }}
|
||||
<div
|
||||
v-for="(item, index) in list1"
|
||||
:key="index"
|
||||
:class="{ active: currentTabIndex === index }"
|
||||
@click="click(item)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</u-navbar>
|
||||
</u-navbar> -->
|
||||
<!-- <u-tabs-swiper ref="tabs" :list="list" :is-scroll="true" current="0"></u-tabs-swiper> -->
|
||||
<u-tabs
|
||||
name="cate_name"
|
||||
count="cate_count"
|
||||
:list="list"
|
||||
:is-scroll="false"
|
||||
:current="current"
|
||||
@change="change"
|
||||
></u-tabs>
|
||||
|
||||
<!-- 商城 -->
|
||||
<tpl ref="tpl" v-if="currentTabIndex == 1" :ste="1" />
|
||||
<!-- 本地生活 -->
|
||||
<tpl ref="tpl" v-if="currentTabIndex == 0" :ste="0" />
|
||||
|
||||
<tpl ref="childComp" v-if="currentTabIndex == 0" :loadMore="loadMore" :ste="0" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import tpl from "@/pages/tabbar/home/views.vue";
|
||||
|
||||
import Views from "./views.vue";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [
|
||||
{
|
||||
name: "本地生活",
|
||||
},
|
||||
{
|
||||
name: "商城",
|
||||
},
|
||||
],
|
||||
current: 0,
|
||||
|
||||
background: {
|
||||
backgroundColor: "#fff",
|
||||
},
|
||||
@ -38,46 +57,49 @@ export default {
|
||||
},
|
||||
],
|
||||
currentTabIndex: 0,
|
||||
current: 0, // tabs组件的current值,表示当前活动的tab选项
|
||||
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
|
||||
loadMore: false, // 本地触底加载更多
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
tpl,
|
||||
},
|
||||
methods: {
|
||||
click(item) {
|
||||
this.currentTabIndex = this.list1.indexOf(item);
|
||||
},
|
||||
onReachBottom() {
|
||||
console.log("触底了");
|
||||
this.loadMore = !this.loadMore;
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.$refs.tpl.init();
|
||||
uni.stopPullDownRefresh();
|
||||
methods: {
|
||||
change(index) {
|
||||
this.current = index;
|
||||
this.currentTabIndex = index;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tab-container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
// background-color: #f0f0f0;
|
||||
// padding: 0 16rpx 0 0;
|
||||
font-size: 18px;
|
||||
}
|
||||
.tab-container div {
|
||||
cursor: pointer;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
.tab-container div.active {
|
||||
border-bottom: 2px solid #F50505;
|
||||
color:#F50505;
|
||||
border-bottom: 2px solid #f50505;
|
||||
color: #f50505;
|
||||
background-color: transparent;
|
||||
}
|
||||
.wrapper {
|
||||
// background: red;
|
||||
}
|
||||
.navbar{
|
||||
.navbar {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
::v-deep {
|
||||
.u-tabs {
|
||||
padding: 25px 20px 0px 20px;
|
||||
}
|
||||
.u-tab-item {
|
||||
color: $main-color !important;
|
||||
}
|
||||
.u-tab-bar {
|
||||
background-color: $light-color !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<div class="menu-list" style="overflow-x: auto; white-space: nowrap; scrollbar-width: none; -ms-overflow-style: none;">
|
||||
<div class="menu-item" v-for="(item, index) in res.list" :key="index">
|
||||
<div>
|
||||
<img class="menu-img" :src="item.img" alt="" @click="tostorePage(item)" />
|
||||
<img class="menu-img" :src="item.img" alt="" @click="modelNavigateTo(item)" />
|
||||
</div>
|
||||
<!-- <div class="menu-title">{{ item.title }}</div> -->
|
||||
</div>
|
||||
@ -22,6 +22,11 @@
|
||||
import { modelNavigateTo } from "./tpl";
|
||||
export default {
|
||||
title: "达人店",
|
||||
data() {
|
||||
return {
|
||||
modelNavigateTo,
|
||||
};
|
||||
},
|
||||
props: ["res","model"],
|
||||
watch: {
|
||||
res: {
|
||||
@ -34,6 +39,8 @@ export default {
|
||||
methods: {
|
||||
//跳转个人店铺
|
||||
tostorePage(val) {
|
||||
console.log(val);
|
||||
|
||||
uni.navigateTo({
|
||||
url: "/pages/product/shopPage?id=" + val.url.id,
|
||||
});
|
||||
@ -91,8 +98,8 @@ export default {
|
||||
}
|
||||
}
|
||||
.menu-img {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
.menu-title {
|
||||
font-size: 12px;
|
||||
|
31
pages/tabbar/home/template/tpl.css
Normal file
@ -0,0 +1,31 @@
|
||||
.image-mode {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
padding: 2rpx;
|
||||
}
|
||||
|
||||
.layout {
|
||||
padding: 16rpx 0rpx 16rpx 0rpx;
|
||||
margin: 8rpx 0;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.layout,
|
||||
.view-height-75,
|
||||
.view-height-150 {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.view-width-100 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.view-height-150 {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.view-height-85 {
|
||||
height: 170rpx;
|
||||
flex: 1;
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
padding: 2rpx;
|
||||
}
|
||||
.layout {
|
||||
padding: 16rpx;
|
||||
padding: 16rpx 0rpx 16rpx 0rpx;
|
||||
margin: 8rpx 0;
|
||||
background: #fff;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div class="addres" @click="showPicker" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
|
||||
{{ cityOrCounty == "" ? "请选择" : cityOrCounty }}
|
||||
</div>
|
||||
<div class="search">{{ res.list[0].title }}</div>
|
||||
<div class="search" @click="handleSearch">{{ res.list[0].title }}</div>
|
||||
<div class="shop" @click="toshop"></div>
|
||||
<m-city
|
||||
:provinceData="list"
|
||||
|
@ -1,8 +1,13 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<div v-for="item in list" :key="item.id" class="shop" @click="handleClick(item)">
|
||||
<div
|
||||
v-for="item in list"
|
||||
:key="item.id"
|
||||
class="shop"
|
||||
@click="handleClick(item)"
|
||||
>
|
||||
<div class="pl_img">
|
||||
<img :src="item.thumbnail" alt="" />
|
||||
<img :src="imgfun(item.thumbnail)" alt="" />
|
||||
<div class="price" style="font-size: 20px">
|
||||
<div>价格:{{ item.price }}¥</div>
|
||||
<div>限量:{{ item.geQuantity }}</div>
|
||||
@ -21,7 +26,7 @@
|
||||
<script>
|
||||
import * as API_home from "@/api/home";
|
||||
export default {
|
||||
props: ["res"],
|
||||
props: ["res","loadMore"],
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
@ -31,12 +36,25 @@ export default {
|
||||
loadMoreStatus: "more", // 加载更多状态
|
||||
};
|
||||
},
|
||||
onReachBottom() {
|
||||
console.log("触底了");
|
||||
},
|
||||
watch: {
|
||||
loadMore: {
|
||||
handler(val) {
|
||||
// this.loadMon()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getlist();
|
||||
window.addEventListener("scroll", this.handleScroll);
|
||||
// 移除原有的滚动监听
|
||||
// window.addEventListener('scroll', this.handleScroll);
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.removeEventListener("scroll", this.handleScroll);
|
||||
// 移除原有的滚动监听
|
||||
// window.removeEventListener('scroll', this.handleScroll);
|
||||
},
|
||||
methods: {
|
||||
getlist() {
|
||||
@ -74,6 +92,15 @@ export default {
|
||||
this.getlist();
|
||||
}
|
||||
},
|
||||
loadMon() {
|
||||
if (this.total == this.list.length) {
|
||||
this.loadMoreStatus = "noMore";
|
||||
return;
|
||||
}
|
||||
this.loadMoreStatus = "loading";
|
||||
this.pageNumber++;
|
||||
this.getlist();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -1,27 +1,42 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<!-- uni 中不能使用 vue component 所以用if判断每个组件 -->
|
||||
<div v-for="(item,index) in pageData.list" :key="index">
|
||||
<div v-for="(item, index) in pageData.list" :key="index">
|
||||
<!-- 搜索栏,如果在楼层装修顶部则会自动浮动,否则不浮动 -->
|
||||
<div class="navbar" v-if="item.type == 'search'" :is-back="false" :is-fixed="false">
|
||||
<search style="width:100%" :res="item.options" />
|
||||
<div
|
||||
class="navbar"
|
||||
v-if="item.type == 'search'"
|
||||
:is-back="false"
|
||||
:is-fixed="false"
|
||||
>
|
||||
<search style="width: 100%" :res="item.options" />
|
||||
<!-- #ifndef H5 -->
|
||||
<!-- 扫码功能 不兼容h5 详情文档: https://uniapp.dcloud.io/api/system/barcode?id=scancode -->
|
||||
<div slot="right" class="navbar-right">
|
||||
<!-- <div slot="right" class="navbar-right">
|
||||
<u-icon name="scan" @click="scan()" color="#666" size="50"></u-icon>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- #endif -->
|
||||
</div>
|
||||
<carousel v-if="item.type == 'carousel'" :res="item.options" />
|
||||
<titleLayout v-if="item.type == 'title'" :res="item.options" />
|
||||
<leftOneRightTwo v-if="item.type == 'leftOneRightTwo'" :res="item.options" />
|
||||
<leftTwoRightOne v-if="item.type == 'leftTwoRightOne'" :res="item.options" />
|
||||
<topOneBottomTwo v-if="item.type == 'topOneBottomTwo'" :res="item.options" />
|
||||
<topTwoBottomOne v-if="item.type == 'topTwoBottomOne'" :res="item.options" />
|
||||
<leftOneRightTwo
|
||||
v-if="item.type == 'leftOneRightTwo'"
|
||||
:res="item.options"
|
||||
/>
|
||||
<leftTwoRightOne
|
||||
v-if="item.type == 'leftTwoRightOne'"
|
||||
:res="item.options"
|
||||
/>
|
||||
<topOneBottomTwo
|
||||
v-if="item.type == 'topOneBottomTwo'"
|
||||
:res="item.options"
|
||||
/>
|
||||
<topTwoBottomOne
|
||||
v-if="item.type == 'topTwoBottomOne'"
|
||||
:res="item.options"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
<flexThree v-if="item.type == 'flexThree'" :res="item.options" />
|
||||
<flexThree v-if="item.type == 'flexThree'" :res="item.options" />
|
||||
<flexFive v-if="item.type == 'flexFive'" :res="item.options" />
|
||||
<flexFour v-if="item.type == 'flexFour'" :res="item.options" />
|
||||
<flexTwo v-if="item.type == 'flexTwo'" :res="item.options" />
|
||||
@ -31,12 +46,11 @@
|
||||
<activity v-if="item.type == 'activity'" :res="item.options" />
|
||||
<Talent v-if="item.type == 'talent'" :res="item.options" :model="item" />
|
||||
<goods v-if="item.type == 'goods'" :res="item.options" />
|
||||
<shop v-if="item.type == 'shop'" :res="item.options" />
|
||||
<shop v-if="item.type == 'shop'" :loadMore="loadMore" :res="item.options" />
|
||||
<group v-if="item.type == 'group'" :res="item.options" />
|
||||
<!-- <joinGroup v-if="item.type == 'joinGroup'" :res="item.options" /> -->
|
||||
<!-- <integral v-if="item.type == 'integral'" :res="item.options" /> -->
|
||||
<!-- <spike v-if="item.type == 'spike'" :res="item.options" /> -->
|
||||
|
||||
</div>
|
||||
<u-no-network></u-no-network>
|
||||
</div>
|
||||
@ -64,9 +78,10 @@ import Talent from "@/pages/tabbar/home/template/Talent"; //达人店
|
||||
import tpl_activity from "@/pages/tabbar/home/template/tpl_activity"; //活动
|
||||
import tpl_shop from "@/pages/tabbar/home/template/tpl_shop"; //活动
|
||||
// 结束引用组件
|
||||
import { getFloorData ,getFloorgetBendi} from "@/api/home"; //获取楼层装修接口
|
||||
import { getFloorData, getFloorgetBendi } from "@/api/home"; //获取楼层装修接口
|
||||
import permision from "@/js_sdk/wa-permission/permission.js"; //权限工具类
|
||||
import config from "@/config/config";
|
||||
import { nextTick } from "vue";
|
||||
// TODO 后续开发
|
||||
// import tpl_join_group from "@/pages/tabbar/home/template/tpl_join_group";
|
||||
// import tpl_integral from "@/pages/tabbar/home/template/tpl_integral";
|
||||
@ -99,7 +114,7 @@ export default {
|
||||
group: tpl_group,
|
||||
Talent,
|
||||
activity: tpl_activity,
|
||||
shop:tpl_shop
|
||||
shop: tpl_shop,
|
||||
// spike: tpl_spike,
|
||||
// joinGroup: tpl_join_group,
|
||||
// integral: tpl_integral,
|
||||
@ -109,14 +124,19 @@ export default {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
loadMore: {
|
||||
type: Boolean,
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
ste(val) {
|
||||
this.init();
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
// 小程序默认分享
|
||||
uni.showShareMenu({ withShareTicket: true });
|
||||
@ -127,27 +147,27 @@ export default {
|
||||
// ste: this.ste,
|
||||
// };
|
||||
// },
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* 实例化首页数据楼层
|
||||
*/
|
||||
init() {
|
||||
uni.setStorageSync('ste', this.ste); // 存储 ste 的值
|
||||
uni.setStorageSync("ste", this.ste); // 存储 ste 的值
|
||||
this.pageData = "";
|
||||
if (this.ste == 1) {
|
||||
getFloorData().then((res) => {
|
||||
if (res.data.success) {
|
||||
this.pageData = JSON.parse(res.data.result.pageData);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
if (res.data.success) {
|
||||
this.pageData = JSON.parse(res.data.result.pageData);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
getFloorgetBendi().then((res) => {
|
||||
if (res.data.success) {
|
||||
this.pageData = JSON.parse(res.data.result.pageData);
|
||||
}
|
||||
});
|
||||
if (res.data.success) {
|
||||
this.pageData = JSON.parse(res.data.result.pageData);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@ -164,7 +184,7 @@ export default {
|
||||
let path = encodeURIComponent(res.result);
|
||||
// WX_CODE 为小程序码
|
||||
if (res.scanType == "WX_CODE") {
|
||||
console.log(res)
|
||||
console.log(res);
|
||||
uni.navigateTo({
|
||||
url: `/${res.path}`,
|
||||
});
|
||||
@ -241,26 +261,26 @@ export default {
|
||||
this.seacnCode();
|
||||
// #endif
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.wrapper{
|
||||
height: 100%;
|
||||
.wrapper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.navbar{
|
||||
.navbar {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background:white;
|
||||
padding-right: 10px;
|
||||
background: white;
|
||||
// padding-right: 10px;
|
||||
}
|
||||
.navbar-right {
|
||||
// padding: 0 16rpx 0 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -18,6 +18,7 @@ export default {
|
||||
},
|
||||
onLoad(params) {
|
||||
this.src = decodeURIComponent(params.src);
|
||||
console.log( this.src,this.webviewStyles,'====');
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -44,7 +44,14 @@
|
||||
<TUIContactsea v-if="statue == 2" @switchConversation="hui" />
|
||||
<!-- 联系人 -->
|
||||
<TUIContact v-else-if="statue == 1" style="height: 100%" />
|
||||
<SelectFriend v-else-if="statue == 3" @con="confn" />
|
||||
<!-- 群选择的 -->
|
||||
<SelectFriend
|
||||
v-else-if="statue == 3"
|
||||
@con="hui"
|
||||
:style="{ marginTop: '20px', heigth: '80%' }"
|
||||
/>
|
||||
<!-- 群类型 -->
|
||||
<CreateGroup v-else-if="statue == 10" @con="confn" />
|
||||
<SelectFriendqlioa v-else-if="statue == 4" @concen="concen" />
|
||||
<!-- 站内信数据 -->
|
||||
<!-- <div > -->
|
||||
@ -89,9 +96,11 @@ import TUIContact from "@/TUIKit/components/TUIContact/index";
|
||||
import TUIContactsea from "@/TUIKit/components/TUIContact/indexsea";
|
||||
import { TUILogin } from "@tencentcloud/tui-core";
|
||||
import ContactSearch from "@/TUIKit/components/TUIContact/contact-search/index.vue";
|
||||
import CreateGroup from "@/TUIKit/components/TUIGroup/create-group/index.vue";
|
||||
import { TUIChatKit } from "@/TUIKit";
|
||||
import SelectFriend from "@/TUIKit/components/TUIContact/select-friend/index.vue";
|
||||
import SelectFriendqlioa from "@/TUIKit/components/TUIGroup/index.vue";
|
||||
|
||||
import TUICore, { ExtensionInfo, TUIConstants } from "@tencentcloud/tui-core";
|
||||
import storage from "@/utils/storage.js";
|
||||
import {
|
||||
@ -99,6 +108,7 @@ import {
|
||||
getMember,
|
||||
getMemberstate,
|
||||
getMemberdelete,
|
||||
geterweijki,
|
||||
} from "@/api/members";
|
||||
TUIChatKit.init();
|
||||
let vueVersion = 2;
|
||||
@ -114,6 +124,7 @@ export default {
|
||||
SelectFriend,
|
||||
SelectFriendqlioa,
|
||||
TUIChatKit,
|
||||
CreateGroup,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -179,8 +190,8 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
lowerBottom() {
|
||||
if(this.total>=this.meList.length){
|
||||
this.pageSize+=10;
|
||||
if (this.total >= this.meList.length) {
|
||||
this.pageSize += 10;
|
||||
this.getMembermethod();
|
||||
}
|
||||
},
|
||||
@ -204,7 +215,7 @@ export default {
|
||||
},
|
||||
//完成跳转群名
|
||||
confn() {
|
||||
// this.statue = 0;
|
||||
this.statue = 0;
|
||||
this.isPopupVisible = false;
|
||||
},
|
||||
concen() {
|
||||
@ -239,7 +250,6 @@ export default {
|
||||
this.tole = this.meList.filter(
|
||||
(item) => item.status === "UN_READY"
|
||||
).length;
|
||||
|
||||
});
|
||||
},
|
||||
handleMenu() {
|
||||
@ -266,13 +276,18 @@ export default {
|
||||
this.isPopupVisible = false;
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
console.log("扫码结果:", res);
|
||||
this.statue=0
|
||||
console.log("扫码结果:---", res);
|
||||
geterweijki(res.result).then((resfn) => {
|
||||
console.log(resfn, "====");
|
||||
this.getUserimInfo();
|
||||
this.statue = 0;
|
||||
});
|
||||
this.statue = 0;
|
||||
// 可以在这里添加处理扫码结果的逻辑
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error("扫码失败:", err);
|
||||
this.statue=0
|
||||
this.statue = 0;
|
||||
},
|
||||
});
|
||||
},
|
||||
@ -460,7 +475,7 @@ page {
|
||||
overflow: hidden;
|
||||
border: 1px solid #d9d9d9;
|
||||
width: 98%;
|
||||
margin-top: 10px;
|
||||
margin: 10px 10px 10px 5px;
|
||||
position: relative;
|
||||
}
|
||||
.content {
|
||||
@ -498,4 +513,5 @@ page {
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -6,61 +6,92 @@
|
||||
</view>
|
||||
<view class="header" @click="userDetail">
|
||||
<view class="head-1">
|
||||
<image :src="userInfo.face || '/static/missing-face.png'"></image>
|
||||
<image :src="userInfo.face || '/static/imlogo.png'"></image>
|
||||
</view>
|
||||
<view class="head-2" v-if="userInfo.id">
|
||||
<view class="user-name">{{ userInfo.nickName }}</view>
|
||||
</view>
|
||||
|
||||
<view class="head-2" v-else>
|
||||
<view class="user-name">登录/注册</view>
|
||||
</view>
|
||||
<u-icon style="display: flex;align-items: flex-start;" name="arrow-right"></u-icon>
|
||||
<u-icon
|
||||
style="display: flex; align-items: flex-start"
|
||||
name="arrow-right"
|
||||
></u-icon>
|
||||
</view>
|
||||
<!-- 积分,优惠券,关注, -->
|
||||
<div class="pointBox box">
|
||||
<u-row text-align="center" gutter="16" class="point">
|
||||
<u-col text-align="center" span="4" @click="navigateTo('/pages/mine/deposit/operation')">
|
||||
<u-col
|
||||
text-align="center"
|
||||
span="4"
|
||||
@click="navigateTo('/pages/mine/deposit/operation')"
|
||||
>
|
||||
<view>预存款</view>
|
||||
<view class="money">{{ walletNum | unitPrice}}</view>
|
||||
<view class="money">{{ walletNum | unitPrice }}</view>
|
||||
</u-col>
|
||||
|
||||
<u-col text-align="center" span="4" @click="navigateTo('/pages/cart/coupon/myCoupon')">
|
||||
<u-col
|
||||
text-align="center"
|
||||
span="4"
|
||||
@click="navigateTo('/pages/cart/coupon/myCoupon')"
|
||||
>
|
||||
<view>优惠券</view>
|
||||
<view>{{ couponNum || 0 }}</view>
|
||||
</u-col>
|
||||
|
||||
<u-col text-align="center" span="4" @click="navigateTo('/pages/mine/myTracks')">
|
||||
<u-col
|
||||
text-align="center"
|
||||
span="4"
|
||||
@click="navigateTo('/pages/mine/myTracks')"
|
||||
>
|
||||
<view>足迹</view>
|
||||
<view>{{ footNum || 0 }}</view>
|
||||
</u-col>
|
||||
</u-row>
|
||||
<!-- 我的订单,代付款 -->
|
||||
<view class="order">
|
||||
<view class="order-item" @click="navigateTo('/pages/order/myOrder?status=0')">
|
||||
<view
|
||||
class="order-item"
|
||||
@click="navigateTo('/pages/order/myOrder?status=0')"
|
||||
>
|
||||
<div class="bag bag1">
|
||||
<u-icon name="order" size="35" color="#fff"></u-icon>
|
||||
</div>
|
||||
<view>我的订单</view>
|
||||
</view>
|
||||
<view class="order-item" @click="navigateTo('/pages/order/myOrder?status=1')">
|
||||
<view
|
||||
class="order-item"
|
||||
@click="navigateTo('/pages/order/myOrder?status=1')"
|
||||
>
|
||||
<div class="bag bag2">
|
||||
<u-icon name="bag-fill" size="35" color="#fff"></u-icon>
|
||||
</div>
|
||||
<view>待付款</view>
|
||||
</view>
|
||||
<view class="order-item" @click="navigateTo('/pages/order/myOrder?status=3')">
|
||||
<view
|
||||
class="order-item"
|
||||
@click="navigateTo('/pages/order/myOrder?status=3')"
|
||||
>
|
||||
<div class="bag bag3">
|
||||
<u-icon name="car-fill" size="35" color="#fff"></u-icon>
|
||||
</div>
|
||||
<view>待收货</view>
|
||||
</view>
|
||||
<view class="order-item" @click="navigateTo('/pages/order/evaluate/myEvaluate')">
|
||||
<view
|
||||
class="order-item"
|
||||
@click="navigateTo('/pages/order/evaluate/myEvaluate')"
|
||||
>
|
||||
<div class="bag bag4">
|
||||
<u-icon name="star-fill" size="35" color="#fff"></u-icon>
|
||||
</div>
|
||||
<view>待评价</view>
|
||||
</view>
|
||||
<view class="order-item" @click="navigateTo('/pages/order/afterSales/afterSales')">
|
||||
<view
|
||||
class="order-item"
|
||||
@click="navigateTo('/pages/order/afterSales/afterSales')"
|
||||
>
|
||||
<div class="bag bag5">
|
||||
<u-icon name="server-fill" size="35" color="#fff"></u-icon>
|
||||
</div>
|
||||
@ -70,8 +101,7 @@
|
||||
</div>
|
||||
<!-- 常用工具 -->
|
||||
|
||||
<tool />
|
||||
|
||||
<tool :userInfo="userInfo" v-if="userInfo.id != undefined" ref="tool"/>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
@ -105,6 +135,8 @@ export default {
|
||||
onPullDownRefresh() {
|
||||
this.getUserOrderNum();
|
||||
this.userInfo = this.$options.filters.isLogin();
|
||||
this.$refs.tool.getUser();
|
||||
|
||||
},
|
||||
// #ifndef MP
|
||||
onNavigationBarButtonTap(e) {
|
||||
@ -129,7 +161,7 @@ export default {
|
||||
userDetail() {
|
||||
this.userInfo.id
|
||||
? this.navigateTo("/pages/mine/set/personMsg")
|
||||
: this.$options.filters.navigateToLogin();;
|
||||
: this.$options.filters.navigateToLogin();
|
||||
},
|
||||
async getUserOrderNum() {
|
||||
uni.stopPullDownRefresh();
|
||||
|
@ -13,7 +13,7 @@
|
||||
<view class="scroll-con">
|
||||
<view v-if="nomsg">没有相似商品</view>
|
||||
<view v-else class="con" v-for="(item,index) in goodsList" :key="index" @click="goDetail(item)">
|
||||
<image :src="item.content.thumbnail" mode=""></image>
|
||||
<image :src="imgfun(item.content.thumbnail)" mode=""></image>
|
||||
<view class="nowrap">{{item.content.name}}</view>
|
||||
<view>
|
||||
<text>¥{{item.content.price | unitPrice}}
|
||||
|
@ -2,59 +2,135 @@
|
||||
<view>
|
||||
<!-- 常用工具 -->
|
||||
<view class="interact-tools" style="margin-bottom: 15px">
|
||||
|
||||
<div class="paddingBox">
|
||||
<view class="interact-container">
|
||||
<view
|
||||
class="interact-item"
|
||||
@click="navigateTo('/pages/mine/invite')"
|
||||
v-if="userInfo.expert"
|
||||
>
|
||||
<image src="/static/mine/stion.png" mode=""></image>
|
||||
<view>我的推荐</view>
|
||||
</view>
|
||||
<view
|
||||
class="interact-item"
|
||||
@click="navigateTo('/pages/mine/inviteinput')"
|
||||
v-if="!userInfo.expert"
|
||||
>
|
||||
<image src="/static/mine/smk.png" mode=""></image>
|
||||
<view>邀请</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="userInfo.expert != 1"
|
||||
class="interact-item"
|
||||
@click="navigateTo('/pages/mine/expert/index')"
|
||||
>
|
||||
<image src="/static/mine/mon.png" mode=""></image>
|
||||
<view>达人申请</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="userInfo.storeId == null || userInfo.storeId == ''"
|
||||
class="interact-item"
|
||||
@click="navigateTo('/pages/mine/openShop/index')"
|
||||
>
|
||||
<image src="/static/mine/shop.png" mode=""></image>
|
||||
<view>店铺申请</view>
|
||||
</view>
|
||||
<!-- <view class="interact-item" @click="navigateTo('/pages/mine/makeMoney/index')">
|
||||
<image src="/static/mine/mony.png" mode=""></image>
|
||||
<view>赚钱</view>
|
||||
</view> -->
|
||||
<view class="interact-item" @click="navigateTo('/pages/mine/signIn')">
|
||||
<image src="/static/mine/sign.png" mode=""></image>
|
||||
<view>每日签到</view>
|
||||
</view>
|
||||
<view class="interact-item" @click="navigateTo('/pages/mine/point/myPoint')">
|
||||
<view
|
||||
class="interact-item"
|
||||
@click="navigateTo('/pages/mine/point/myPoint')"
|
||||
>
|
||||
<image src="/static/mine/mypoint.png" mode=""></image>
|
||||
<view>我的积分</view>
|
||||
</view>
|
||||
<view class="interact-item" @click="navigateTo('/pages/cart/coupon/myCoupon')">
|
||||
<view
|
||||
class="interact-item"
|
||||
@click="navigateTo('/pages/cart/coupon/myCoupon')"
|
||||
>
|
||||
<image src="/static/mine/mycoupon.png" mode=""></image>
|
||||
<view>优惠券</view>
|
||||
</view>
|
||||
<view class="interact-item" @click="navigateTo('/pages/mine/myCollect')">
|
||||
<view
|
||||
class="interact-item"
|
||||
@click="navigateTo('/pages/mine/myCollect')"
|
||||
>
|
||||
<image src="/static/mine/myfavorite.png" mode=""></image>
|
||||
<view>我的关注</view>
|
||||
</view>
|
||||
<view class="interact-item" @click="navigateTo('/pages/mine/myTracks')">
|
||||
<view
|
||||
class="interact-item"
|
||||
@click="navigateTo('/pages/mine/myTracks')"
|
||||
>
|
||||
<image src="/static/mine/myhistory.png" mode=""></image>
|
||||
<view>我的足迹</view>
|
||||
</view>
|
||||
<view class="interact-item" @click="navigateTo('/pages/order/evaluate/myEvaluate')">
|
||||
<view
|
||||
class="interact-item"
|
||||
@click="navigateTo('/pages/order/evaluate/myEvaluate')"
|
||||
>
|
||||
<image src="/static/mine/mycommit.png" mode=""></image>
|
||||
<view>我的评价</view>
|
||||
</view>
|
||||
<view class="interact-item" @click="navigateTo('/pages/order/complain/complainList')">
|
||||
<view
|
||||
class="interact-item"
|
||||
@click="navigateTo('/pages/order/complain/complainList')"
|
||||
>
|
||||
<image src="/static/mine/shensu.png" mode=""></image>
|
||||
<view>我的投诉</view>
|
||||
</view>
|
||||
|
||||
<view class="interact-item" @click="navigateTo('/pages/mine/set/feedBack')">
|
||||
<view
|
||||
class="interact-item"
|
||||
@click="navigateTo('/pages/mine/set/feedBack')"
|
||||
>
|
||||
<image src="/static/mine/feedback.png" mode=""></image>
|
||||
<view>意见反馈</view>
|
||||
</view>
|
||||
<view class="interact-item" @click="navigateTo('/pages/cart/coupon/couponCenter')">
|
||||
<view
|
||||
class="interact-item"
|
||||
@click="navigateTo('/pages/cart/coupon/couponCenter')"
|
||||
>
|
||||
<image src="/static/mine/couponcenter.png" mode=""></image>
|
||||
<view>领券中心</view>
|
||||
</view>
|
||||
<view class="interact-item" @click="navigateTo('/pages/mine/address/addressManage')">
|
||||
<view
|
||||
class="interact-item"
|
||||
@click="navigateTo('/pages/mine/address/addressManage')"
|
||||
>
|
||||
<image src="/static/mine/myaddress.png" mode=""></image>
|
||||
<view>地址管理</view>
|
||||
</view>
|
||||
<view class="interact-item" @click="navigateTo('/pages/mine/set/setUp')">
|
||||
<view
|
||||
class="interact-item"
|
||||
@click="navigateTo('/pages/mine/set/setUp')"
|
||||
>
|
||||
<image src="/static/mine/setting.png" mode=""></image>
|
||||
<view>设置</view>
|
||||
</view>
|
||||
<view class="interact-item" @click="distribution">
|
||||
<view
|
||||
class="interact-item"
|
||||
@click="navigateTo('/pages/mine/mydistribution/index')"
|
||||
v-if="userInfo.expert"
|
||||
>
|
||||
<image src="/static/mine/distribution.png" mode=""></image>
|
||||
<view>我的分销</view>
|
||||
</view>
|
||||
<view class="interact-item" @click="navigateTo('/pages/promotion/bargain/log')">
|
||||
<!-- <view class="interact-item" @click="distribution">
|
||||
<image src="/static/mine/distribution.png" mode=""></image>
|
||||
<view>我的分销</view>
|
||||
</view> -->
|
||||
<view
|
||||
class="interact-item"
|
||||
@click="navigateTo('/pages/promotion/bargain/log')"
|
||||
>
|
||||
<image src="/static/mine/kanjia.png" mode=""></image>
|
||||
<view>砍价记录</view>
|
||||
</view>
|
||||
@ -66,8 +142,31 @@
|
||||
|
||||
<script>
|
||||
import { distribution } from "@/api/goods";
|
||||
import { getUserInfo } from "@/api/members";
|
||||
export default {
|
||||
props: {
|
||||
// userInfo: {
|
||||
// type: Object,
|
||||
// default: () => {},
|
||||
// },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
userInfo: {}, // 用户信息
|
||||
};
|
||||
},
|
||||
onShow() {},
|
||||
onLoad() {},
|
||||
|
||||
mounted() {
|
||||
this.getUser();
|
||||
},
|
||||
methods: {
|
||||
getUser() {
|
||||
getUserInfo().then((user) => {
|
||||
this.userInfo = user.data.result;
|
||||
});
|
||||
},
|
||||
navigateTo(url) {
|
||||
uni.navigateTo({
|
||||
url,
|
||||
@ -121,7 +220,6 @@ export default {
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
|
||||
|
||||
.interactBox {
|
||||
height: 156rpx;
|
||||
}
|
||||
|
50
plugins/Reg/RegExp.js
Normal file
@ -0,0 +1,50 @@
|
||||
/**
|
||||
* 各种正则表达式
|
||||
* mobile 手机号
|
||||
* email 电子邮箱
|
||||
* password 密码【6-20位】
|
||||
* integer 正整数【不包含0】
|
||||
* money 金钱
|
||||
* TINumber 纳税识别号
|
||||
* IDCard 身份证
|
||||
* userName 账户名称【汉字、字母、数字、“-”、“_”的组合】
|
||||
* URL URL
|
||||
* TEL 固定电话
|
||||
*/
|
||||
|
||||
// 手机号
|
||||
export const mobile = /^0?(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])[0-9]{8}$/;
|
||||
|
||||
// 电子邮箱
|
||||
export const email = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
|
||||
|
||||
// 密码【6-20位】
|
||||
export const password = /^[@A-Za-z0-9!#$%^&*.~,]{6,20}$/;
|
||||
|
||||
// 正整数【不包含0】
|
||||
export const integer = /^[1-9]\d*$/;
|
||||
|
||||
// 正整数【包含0】
|
||||
export const Integer = /^[0-9]\d*$/;
|
||||
|
||||
// 金钱
|
||||
export const money = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
|
||||
|
||||
// 纳税识别号
|
||||
export const TINumber = /^((\d{6}[0-9A-Z]{9})|([0-9A-Za-z]{2}\d{6}[0-9A-Za-z]{10,12}))$/;
|
||||
|
||||
// 身份证
|
||||
export const IDCard = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
|
||||
|
||||
// 账户名称【汉字、字母、数字、“-”、“_”的组合】
|
||||
export const userName = /[A-Za-z0-9_\-\u4e00-\u9fa5]$/;
|
||||
|
||||
// URL
|
||||
export const URL =
|
||||
/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/;
|
||||
|
||||
// 固话
|
||||
export const TEL = /0\d{2,3}-\d{7,8}/;
|
||||
|
||||
// 营业执照号
|
||||
export const licenseNum = /(^(?:(?![IOZSV])[\dA-Z]){2}\d{6}(?:(?![IOZSV])[\dA-Z]){10}$)|(^\d{15}$)/;
|
BIN
static/abcx.png
Normal file
After Width: | Height: | Size: 229 KiB |
BIN
static/imlogo.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
static/logn.png
Normal file
After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 752 B After Width: | Height: | Size: 3.9 KiB |
BIN
static/mine/mon.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
static/mine/mony.png
Normal file
After Width: | Height: | Size: 7.6 KiB |
BIN
static/mine/shop.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
static/mine/smk.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
static/mine/stion.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
static/shop.png
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 6.9 KiB |
152
uni.css
Normal file
@ -0,0 +1,152 @@
|
||||
@charset "UTF-8";
|
||||
/* 页面左右间距 */
|
||||
/* 文字尺寸 */
|
||||
/*文字颜色*/
|
||||
/* 边框颜色 */
|
||||
/* 图片加载中颜色 */
|
||||
/* 行为相关颜色 */
|
||||
/*主题颜色 具体参考 https://ant.design/docs/spec/colors-cn */
|
||||
/**微信登录按钮颜色 */
|
||||
/**主颜色*/
|
||||
/*用于金钱等颜色 */
|
||||
/*主题高亮颜色*/
|
||||
/*辅助高亮颜色*/
|
||||
/*主题高亮背景颜色*/
|
||||
/*价格红高亮背景颜色*/
|
||||
/*辅助色*/
|
||||
.light-color {
|
||||
color: #fe3c3c;
|
||||
}
|
||||
|
||||
.main-color {
|
||||
color: #fe3c3c !important;
|
||||
}
|
||||
|
||||
.bg-light-color {
|
||||
/* #ifndef APP-NVUE */
|
||||
background-color: #fe3c3c !important;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.bg-light-color /deep/ * {
|
||||
background-color: #fe3c3c !important;
|
||||
}
|
||||
|
||||
.bg-main-color {
|
||||
background-color: #fe3c3c !important;
|
||||
}
|
||||
|
||||
.bg-linear-gradient {
|
||||
background-image: linear-gradient(25deg, #fa123b, #ff6b35, #ff9f28, #ffcc03);
|
||||
}
|
||||
|
||||
/* #ifndef APP-NVUE */
|
||||
.uni-tabbar .uni-tabbar__icon {
|
||||
width: 20px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.btn {
|
||||
background-color: #fe3c3c;
|
||||
color: #ffffff;
|
||||
border-width: 0px;
|
||||
/* #ifndef APP-NVUE */
|
||||
border: none;
|
||||
/* #endif */
|
||||
border-color: transparent;
|
||||
border-radius: 44px;
|
||||
height: 44px;
|
||||
box-shadow: none;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
line-height: 44px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn::after {
|
||||
/* #ifndef APP-NVUE */
|
||||
border: none;
|
||||
/* #endif */
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.button-hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.margin {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.tag {
|
||||
background-color: #f2f2f2;
|
||||
color: #333333;
|
||||
height: 28px;
|
||||
border-radius: 28px;
|
||||
box-shadow: none;
|
||||
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
line-height: 28px;
|
||||
text-align: center;
|
||||
width: 90px;
|
||||
}
|
||||
|
||||
.c-content {
|
||||
background-color: #ffffff;
|
||||
border-top: 1px solid #ebeef5;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
}
|
||||
|
||||
.mt-30 {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.border-top {
|
||||
border-top: 1px solid #ebeef5;
|
||||
}
|
||||
|
||||
.describe {
|
||||
color: #909399;
|
||||
font-size: 24rpx;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.flex-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.flex-a-c {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.relative {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* #ifndef APP-NVUE */
|
||||
.wes {
|
||||
/* 多出部分用省略号表示 , 用于一行 */
|
||||
overflow: hidden;
|
||||
word-wrap: normal;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.wes-2 {
|
||||
/* 适用于webkit内核和移动端 */
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* #endif */
|
8
uni.scss
@ -29,13 +29,13 @@ $uni-color-error: #dd524d;
|
||||
/**微信登录按钮颜色 */
|
||||
$weChat-color:#00a327;
|
||||
/**主颜色*/
|
||||
$main-color: #ff3c2a;
|
||||
$main-color: #fe3c3c;
|
||||
/*用于金钱等颜色 */
|
||||
$price-color: #ff3c2a;
|
||||
$price-color: #fe3c3c;
|
||||
/*主题高亮颜色*/
|
||||
$light-color: #ff6b35;
|
||||
$light-color: #fe3c3c;
|
||||
/*辅助高亮颜色*/
|
||||
$aider-light-color: #ff9f28;
|
||||
$aider-light-color: #fe3c3c;
|
||||
|
||||
/*主题高亮背景颜色*/
|
||||
$main-light-color: #edfcf7;
|
||||
|
342
utils/request.js
@ -1,217 +1,211 @@
|
||||
import Request from "@/lib/request/index.js";
|
||||
import {
|
||||
refreshTokenFn
|
||||
} from "@/api/login.js";
|
||||
import { refreshTokenFn } from "@/api/login.js";
|
||||
import storage from "@/utils/storage.js";
|
||||
import {
|
||||
md5
|
||||
} from "@/utils/md5.js";
|
||||
import { md5 } from "@/utils/md5.js";
|
||||
import Foundation from "@/utils/Foundation.js";
|
||||
import api from "@/config/api.js";
|
||||
|
||||
import uuid from "@/utils/uuid.modified.js";
|
||||
|
||||
function cleanStorage() {
|
||||
uni.showToast({
|
||||
title: "你的登录状态已过期,请重新登录",
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
});
|
||||
if (uni.showLoading()) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.showToast({
|
||||
title: "你的登录状态已过期,请重新登录",
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
});
|
||||
if (uni.showLoading()) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
|
||||
storage.setHasLogin(false);
|
||||
storage.setAccessToken("");
|
||||
storage.setRefreshToken("");
|
||||
console.log("清空token");
|
||||
storage.setUuid("");
|
||||
storage.setUserInfo({});
|
||||
// 清理vlog信息
|
||||
storage.setVlogToken("")
|
||||
storage.setVlogUserInfo({})
|
||||
// 清除初始化数据内容
|
||||
storage.setRefreshVlogIndex('0') //不需要刷新
|
||||
storage.setHasLogin(false);
|
||||
storage.setAccessToken("");
|
||||
storage.setRefreshToken("");
|
||||
console.log("清空token");
|
||||
storage.setUuid("");
|
||||
storage.setUserInfo({});
|
||||
// 清理vlog信息
|
||||
storage.setVlogToken("");
|
||||
storage.setVlogUserInfo({});
|
||||
// 清除初始化数据内容
|
||||
storage.setRefreshVlogIndex("0"); //不需要刷新
|
||||
|
||||
// 防抖处理跳转
|
||||
// #ifdef MP-WEIXIN
|
||||
// 防抖处理跳转
|
||||
// #ifdef MP-WEIXIN
|
||||
|
||||
uni.navigateTo({
|
||||
url: "/pages/passport/wechatMPLogin",
|
||||
});
|
||||
uni.navigateTo({
|
||||
url: "/pages/passport/wechatMPLogin",
|
||||
});
|
||||
|
||||
// #endif
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-WEIXIN
|
||||
// #ifndef MP-WEIXIN
|
||||
|
||||
uni.navigateTo({
|
||||
url: "/pages/passport/login",
|
||||
});
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
const currentRoute = currentPage.route;
|
||||
console.log(currentRoute,'===');
|
||||
|
||||
// #endif
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url: "/pages/passport/login",
|
||||
});
|
||||
}, 5000);
|
||||
|
||||
// #endif
|
||||
}
|
||||
|
||||
let http = new Request();
|
||||
|
||||
|
||||
http.setConfig((config) => {
|
||||
// 没有uuid创建
|
||||
if (!storage.getUuid()) {
|
||||
storage.setUuid(uuid.v1());
|
||||
}
|
||||
// 没有uuid创建
|
||||
if (!storage.getUuid()) {
|
||||
storage.setUuid(uuid.v1());
|
||||
}
|
||||
|
||||
/* 设置全局配置 */
|
||||
config.baseURL = api.buyer;
|
||||
config.header = {
|
||||
...config.header,
|
||||
};
|
||||
config.validateStatus = (statusCode) => {
|
||||
// 不论什么状态,统一在正确中处理
|
||||
return true;
|
||||
};
|
||||
return config;
|
||||
/* 设置全局配置 */
|
||||
config.baseURL = api.buyer;
|
||||
config.header = {
|
||||
...config.header,
|
||||
};
|
||||
config.validateStatus = (statusCode) => {
|
||||
// 不论什么状态,统一在正确中处理
|
||||
return true;
|
||||
};
|
||||
return config;
|
||||
});
|
||||
|
||||
http.interceptors.request.use(
|
||||
(config) => {
|
||||
/* 请求之前拦截器。可以使用async await 做异步操作 */
|
||||
let accessToken = storage.getAccessToken();
|
||||
(config) => {
|
||||
/* 请求之前拦截器。可以使用async await 做异步操作 */
|
||||
let accessToken = storage.getAccessToken();
|
||||
|
||||
if (accessToken) {
|
||||
const nonce = Foundation.randomString(6);
|
||||
const timestamp = parseInt(new Date().getTime() / 1000);
|
||||
const sign = md5(nonce + timestamp + accessToken);
|
||||
const _params = {
|
||||
nonce,
|
||||
timestamp,
|
||||
sign,
|
||||
};
|
||||
let params = config.params || {};
|
||||
params = {
|
||||
...params,
|
||||
..._params
|
||||
};
|
||||
if (accessToken) {
|
||||
const nonce = Foundation.randomString(6);
|
||||
const timestamp = parseInt(new Date().getTime() / 1000);
|
||||
const sign = md5(nonce + timestamp + accessToken);
|
||||
const _params = {
|
||||
nonce,
|
||||
timestamp,
|
||||
sign,
|
||||
};
|
||||
let params = config.params || {};
|
||||
params = {
|
||||
...params,
|
||||
..._params,
|
||||
};
|
||||
|
||||
config.params = params;
|
||||
config.header.accessToken = accessToken;
|
||||
|
||||
}
|
||||
// 配置vlog所需参数
|
||||
let vlogToken = storage.getVlogToken();
|
||||
let vlogId = storage.getVlogUserInfo();
|
||||
// console.log(vlogId)
|
||||
// console.log(vlogToken)
|
||||
if(vlogToken){
|
||||
config.header.headerUserToken = vlogToken;
|
||||
config.header.headerUserId = vlogId.id;
|
||||
}
|
||||
config.header = {
|
||||
...config.header,
|
||||
uuid: storage.getUuid() || uuid.v1(),
|
||||
};
|
||||
// console.log(config)
|
||||
return config;
|
||||
},
|
||||
(config) => {
|
||||
return Promise.reject(config);
|
||||
}
|
||||
config.params = params;
|
||||
config.header.accessToken = accessToken;
|
||||
}
|
||||
// 配置vlog所需参数
|
||||
let vlogToken = storage.getVlogToken();
|
||||
let vlogId = storage.getVlogUserInfo();
|
||||
// console.log(vlogId)
|
||||
// console.log(vlogToken)
|
||||
if (vlogToken) {
|
||||
config.header.headerUserToken = vlogToken;
|
||||
config.header.headerUserId = vlogId.id;
|
||||
}
|
||||
config.header = {
|
||||
...config.header,
|
||||
uuid: storage.getUuid() || uuid.v1(),
|
||||
};
|
||||
// console.log(config)
|
||||
return config;
|
||||
},
|
||||
(config) => {
|
||||
return Promise.reject(config);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// 是否正在刷新的标记
|
||||
let isRefreshing = false;
|
||||
//重试队列
|
||||
let requests = [];
|
||||
// 必须使用异步函数,注意
|
||||
http.interceptors.response.use(
|
||||
async (response) => {
|
||||
// console.log(isRefreshing)
|
||||
// console.log(response)
|
||||
/* 请求之后拦截器。可以使用async await 做异步操作 */
|
||||
// token存在并且token过期
|
||||
if (isRefreshing && response.statusCode === 403) {
|
||||
cleanStorage();
|
||||
isRefreshing = false;
|
||||
}
|
||||
async (response) => {
|
||||
// console.log(isRefreshing)
|
||||
// console.log(response)
|
||||
/* 请求之后拦截器。可以使用async await 做异步操作 */
|
||||
// token存在并且token过期
|
||||
if (isRefreshing && response.statusCode === 403) {
|
||||
cleanStorage();
|
||||
isRefreshing = false;
|
||||
}
|
||||
|
||||
let token = storage.getAccessToken();
|
||||
if (
|
||||
(token && response.statusCode === 403) ||
|
||||
response.data.status === 403
|
||||
) {
|
||||
if (!isRefreshing) {
|
||||
isRefreshing = true;
|
||||
//调用刷新token的接口
|
||||
return refreshTokenFn(storage.getRefreshToken())
|
||||
.then((res) => {
|
||||
let {
|
||||
accessToken,
|
||||
refreshToken
|
||||
} = res.data.result;
|
||||
storage.setAccessToken(accessToken);
|
||||
storage.setRefreshToken(refreshToken);
|
||||
let token = storage.getAccessToken();
|
||||
if (
|
||||
(token && response.statusCode === 403) ||
|
||||
response.data.status === 403
|
||||
) {
|
||||
if (!isRefreshing) {
|
||||
isRefreshing = true;
|
||||
//调用刷新token的接口
|
||||
return refreshTokenFn(storage.getRefreshToken())
|
||||
.then((res) => {
|
||||
let { accessToken, refreshToken } = res.data.result;
|
||||
storage.setAccessToken(accessToken);
|
||||
storage.setRefreshToken(refreshToken);
|
||||
|
||||
response.header.accessToken = `${accessToken}`;
|
||||
// token 刷新后将数组的方法重新执行
|
||||
requests.forEach((cb) => cb(accessToken));
|
||||
requests = []; // 重新请求完清空
|
||||
return http.request(response.config);
|
||||
})
|
||||
.catch((err) => {
|
||||
cleanStorage();
|
||||
return Promise.reject(err);
|
||||
})
|
||||
.finally(() => {
|
||||
isRefreshing = false;
|
||||
});
|
||||
} else {
|
||||
// 返回未执行 resolve 的 Promise
|
||||
return new Promise((resolve) => {
|
||||
// 用函数形式将 resolve 存入,等待刷新后再执行
|
||||
requests.push((token) => {
|
||||
response.header.accessToken = `${token}`;
|
||||
resolve(http.request(response.config));
|
||||
});
|
||||
});
|
||||
}
|
||||
response.header.accessToken = `${accessToken}`;
|
||||
// token 刷新后将数组的方法重新执行
|
||||
requests.forEach((cb) => cb(accessToken));
|
||||
requests = []; // 重新请求完清空
|
||||
return http.request(response.config);
|
||||
})
|
||||
.catch((err) => {
|
||||
cleanStorage();
|
||||
return Promise.reject(err);
|
||||
})
|
||||
.finally(() => {
|
||||
isRefreshing = false;
|
||||
});
|
||||
} else {
|
||||
// 返回未执行 resolve 的 Promise
|
||||
return new Promise((resolve) => {
|
||||
// 用函数形式将 resolve 存入,等待刷新后再执行
|
||||
requests.push((token) => {
|
||||
response.header.accessToken = `${token}`;
|
||||
resolve(http.request(response.config));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 如果当前返回没登录
|
||||
} else if (
|
||||
(!token && response.statusCode === 403) ||
|
||||
response.data.code === 403
|
||||
) {
|
||||
cleanStorage();
|
||||
// 如果当前返回没登录
|
||||
} else if (
|
||||
(!token && response.statusCode === 403) ||
|
||||
response.data.code === 403
|
||||
) {
|
||||
cleanStorage();
|
||||
|
||||
// 如果当前状态码为正常但是success为不正常时
|
||||
} else if (
|
||||
(response.statusCode == 200 && !response.data.success) ||
|
||||
response.statusCode == 400
|
||||
) {
|
||||
if (response.data.message) {
|
||||
uni.showToast({
|
||||
title: response.data.message,
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (response.data.code==502){
|
||||
cleanStorage();
|
||||
}
|
||||
return response;
|
||||
},
|
||||
(error) => {
|
||||
return error;
|
||||
}
|
||||
// 如果当前状态码为正常但是success为不正常时
|
||||
} else if (
|
||||
(response.statusCode == 200 && !response.data.success) ||
|
||||
response.statusCode == 400
|
||||
) {
|
||||
if (response.data.message) {
|
||||
uni.showToast({
|
||||
title: response.data.message,
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
});
|
||||
}
|
||||
} else if (response.data.code == 502) {
|
||||
cleanStorage();
|
||||
}
|
||||
return response;
|
||||
},
|
||||
(error) => {
|
||||
return error;
|
||||
}
|
||||
);
|
||||
|
||||
export {
|
||||
http
|
||||
};
|
||||
export { http };
|
||||
|
||||
export const Method = {
|
||||
GET: "GET",
|
||||
POST: "POST",
|
||||
PUT: "PUT",
|
||||
DELETE: "DELETE",
|
||||
GET: "GET",
|
||||
POST: "POST",
|
||||
PUT: "PUT",
|
||||
DELETE: "DELETE",
|
||||
};
|