Commit bca5d83e by 肖康

Merge branch 'master' of http://git.ichunt.net/xiaokang/H5_2.0

parents 28901f85 2c80d95c
...@@ -6,6 +6,13 @@ ...@@ -6,6 +6,13 @@
"description": "", "description": "",
"glyphs": [ "glyphs": [
{ {
"icon_id": "35598904",
"name": "矩形",
"font_class": "juxing3",
"unicode": "e799",
"unicode_decimal": 59289
},
{
"icon_id": "35575744", "icon_id": "35575744",
"name": "矩形", "name": "矩形",
"font_class": "juxing2", "font_class": "juxing2",
......
.page-userCoupdz {
padding-top: 104rpx;
.list {
padding: 0 24rpx;
.box {
padding: 24rpx 16rpx;
background: #ffffff;
border-radius: 10rpx;
margin-bottom: 16rpx;
.p1 {
margin-bottom: 16rpx;
.t1 {
font-size: 28rpx;
font-weight: 600;
}
.t2 {
font-size: 24rpx;
color: #1969f9;
}
.iconfont {
font-size: 32rpx;
color: #1969f9;
margin-right: 8rpx;
}
}
.p2 {
padding-left: 8rpx;
height: 66rpx;
background: #f0f6ff;
border-radius: 10rpx;
margin-bottom: 16rpx;
.t1 {
font-size: 24rpx;
color: #484b59;
}
.t2 {
font-size: 24rpx;
color: #1969f9;
margin-right: 12rpx;
}
.iconfont {
font-size: 24rpx;
color: #484b59;
}
}
.p3 {
font-size: 24rpx;
color: #919399;
margin-bottom: 8rpx;
}
.p4 {
font-size: 24rpx;
color: #919399;
}
}
}
}
.no-data {
image {
width: 356rpx;
height: 356rpx;
}
.tt {
margin-top: 32rpx;
font-size: 28rpx;
color: #292b33;
}
}
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
background: #ffffff; background: #ffffff;
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
border-radius: 0 0 10rpx 10rpx;
.box { .box {
position: relative; position: relative;
grid-column-end: span 1; grid-column-end: span 1;
...@@ -228,6 +229,7 @@ ...@@ -228,6 +229,7 @@
image { image {
width: 100%; width: 100%;
height: 144rpx; height: 144rpx;
border-radius: 10rpx;
} }
} }
} }
......
...@@ -72,6 +72,134 @@ ...@@ -72,6 +72,134 @@
} }
} }
} }
.default {
width: 32rpx;
height: 32rpx;
background: url('https://img.ichunt.com/images/ichunt/202305/19/53c6f67275c83a0f9ccaa565c018cfcd.png') no-repeat center;
background-size: cover;
}
.default-text {
margin-left: 16rpx;
font-size: 24rpx;
color: #919399;
}
.default-curr {
.default {
background: url('https://img.ichunt.com/images/ichunt/202305/19/e6d61a2c75f0185a207904679ec70273.png') no-repeat center;
background-size: cover;
}
.default-text {
color: #1969f9;
}
}
}
}
.btn {
position: fixed;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 100rpx;
z-index: 9;
background: #ffffff;
box-shadow: 0px -4rpx 20rpx 0px rgba(198, 199, 204, 0.1);
border-radius: 10rpx 10rpx 0px 0px;
padding: 0 24rpx;
.btn1 {
width: 100%;
height: 68rpx;
background: #1969f9;
border-radius: 10rpx;
.iconfont {
font-size: 44rpx;
color: #ffffff;
}
.text {
margin-left: 12rpx;
font-size: 28rpx;
color: #ffffff;
}
}
}
.form-box {
margin-bottom: 16rpx;
border-radius: 10rpx;
background: #ffffff;
padding: 0 24rpx;
.input-box {
border-bottom: 1px solid #f0f0f2;
&:last-child {
border-bottom: none;
}
.tt {
width: 155rpx;
font-size: 26rpx;
color: #484b59;
}
.intl_code {
.uni-input {
font-size: 26rpx;
color: #1969f9;
}
.icon-arrbot {
font-size: 32rpx;
color: #919399;
}
}
.area {
width: calc(100% - 155rpx);
.uni-input {
font-size: 26rpx;
color: #919399;
}
.icon-arrbot {
font-size: 32rpx;
color: #919399;
}
}
.uni-input {
height: 100%;
font-size: 26rpx;
&::-webkit-input-placeholder {
color: #919399;
}
}
&.input {
height: 88rpx;
}
&.textarea {
textarea {
padding: 24rpx 24rpx 24rpx 0;
height: 160rpx;
font-size: 26rpx;
&::-webkit-input-placeholder {
color: #919399;
}
}
}
}
}
.setting-default {
padding: 0 24rpx;
height: 88rpx;
background: #ffffff;
border-radius: 10rpx;
.tt {
font-size: 26rpx;
color: #484b59;
} }
} }
} }
.no-data {
image {
width: 356rpx;
height: 356rpx;
}
.tt {
margin-top: 32rpx;
font-size: 28rpx;
color: #292b33;
}
}
import App from './App' import App from './App'
import { request,setCookie,getCookie } from '@/util/util.js' import { request, setCookie, getCookie } from '@/util/util.js'
import filters from '@/filters' import filters from '@/filters'
import router from '@/router/index.js' import router from '@/router/index.js'
import { RouterMount } from 'uni-simple-router' import { RouterMount } from 'uni-simple-router'
...@@ -13,12 +13,6 @@ Vue.prototype.request = request ...@@ -13,12 +13,6 @@ Vue.prototype.request = request
App.mpType = 'app' App.mpType = 'app'
//过滤器遍历 //过滤器遍历
Object.keys(filters).forEach(key => Vue.filter(key, filters[key])); Object.keys(filters).forEach(key => Vue.filter(key, filters[key]));
...@@ -27,58 +21,57 @@ Vue.use(directive); ...@@ -27,58 +21,57 @@ Vue.use(directive);
//生成临时Yo4teW_gid和Yo4teW_csrf //生成临时Yo4teW_gid和Yo4teW_csrf
let time1s = parseInt(new Date().getTime() / 1000); let time = parseInt(new Date().getTime() / 1000);
let gid_= w_md5.hex_md5_32(w_md5.hex_md5_32(String(time1s)+Math.random())+"usersign") let gid_ = w_md5.hex_md5_32(w_md5.hex_md5_32(String(time) + Math.random()) + "usersign")
let csrf_= w_md5.hex_md5_32(w_md5.hex_md5_32(String(time1s)+Math.random())+"csrf") let csrf_ = w_md5.hex_md5_32(w_md5.hex_md5_32(String(time) + Math.random()) + "csrf")
if(!getCookie("Yo4teW_gid")){ if (!getCookie("Yo4teW_gid")) {
setCookie('Yo4teW_gid', gid_, 7); setCookie('Yo4teW_gid', gid_, 15);
} }
if(!getCookie("Yo4teW_csrf")){ if (!getCookie("Yo4teW_csrf")) {
setCookie('Yo4teW_csrf', csrf_, 7); setCookie('Yo4teW_csrf', csrf_, 15);
} }
try { try {
function isPromise(obj) { function isPromise(obj) {
return ( return (
!!obj && !!obj &&
(typeof obj === "object" || typeof obj === "function") && (typeof obj === "object" || typeof obj === "function") &&
typeof obj.then === "function" typeof obj.then === "function"
); );
} }
// 统一 vue2 API Promise 化返回格式与 vue3 保持一致 // 统一 vue2 API Promise 化返回格式与 vue3 保持一致
uni.addInterceptor({ uni.addInterceptor({
returnValue(res) { returnValue(res) {
if (!isPromise(res)) { if (!isPromise(res)) {
return res; return res;
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
res.then((res) => { res.then((res) => {
if (res[0]) { if (res[0]) {
reject(res[0]); reject(res[0]);
} else { } else {
resolve(res[1]); resolve(res[1]);
} }
}); });
}); });
}, },
}); });
} catch (error) { } } catch (error) {}
const app = new Vue({ const app = new Vue({
...App ...App
}) })
//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式 //v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
// #ifdef H5 // #ifdef H5
RouterMount(app,'#app'); RouterMount(app, '#app');
// #endif // #endif
// #ifndef H5 // #ifndef H5
app.$mount()//为了兼容小程序及app端必须这样写才有效果 app.$mount() //为了兼容小程序及app端必须这样写才有效果
// #endif // #endif
// #endif // #endif
...@@ -86,9 +79,9 @@ const app = new Vue({ ...@@ -86,9 +79,9 @@ const app = new Vue({
// #ifdef VUE3 // #ifdef VUE3
import { createSSRApp } from 'vue' import { createSSRApp } from 'vue'
export function createApp() { export function createApp() {
const app = createSSRApp(App) const app = createSSRApp(App)
return { return {
app app
} }
} }
// #endif // #endif
\ No newline at end of file
...@@ -82,6 +82,24 @@ ...@@ -82,6 +82,24 @@
"style": { "style": {
"navigationBarTitleText": "收货地址" "navigationBarTitleText": "收货地址"
} }
},
{
"path": "pages/mine/userAddressAdd",
"style": {
"navigationBarTitleText": "新增地址"
}
},
{
"path": "pages/mine/userAddressEdit",
"style": {
"navigationBarTitleText": "编辑地址"
}
},
{
"path": "pages/mine/coupdz",
"style": {
"navigationBarTitleText": "京东卡"
}
} }
], ],
"globalStyle": { "globalStyle": {
......
<template>
<view class="page-userCoupdz">
<navElement title="京东卡"></navElement>
<view class="list">
<view class="box" v-for="(item, index) in 100" :key="index">
<view class="p1 row bothSide verCenter">
<text class="t1">常规新客12月奖励</text>
<view class="row verCenter">
<text class="iconfont icon-juxing"></text>
<text class="t2">查看</text>
</view>
</view>
<view class="p2 row verCenter">
<text class="t1">卡号:</text>
<text class="t2">jdvd210264522</text>
<text class="iconfont icon-juxing3" style="margin-right: 57rpx;"></text>
<text class="t1">密钥:</text>
<text class="t2">852157</text>
<text class="iconfont icon-juxing3"></text>
</view>
<view class="p3">有效期:2023.01.26-2023.06.26</view>
<view class="p4">创建时间:2023.01.26-2023.06.26</view>
</view>
</view>
<view class="no-data column rowCenter verCenter">
<image src="../../static/nodate.png"></image>
<text class="tt">暂无京东卡信息</text>
</view>
</view>
</template>
<script>
import { Api_Url } from '@/util/api.js';
import navElement from '@/components/nav.vue';
export default {
components: {
navElement
},
data() {
return {};
},
onLoad() {},
methods: {}
};
</script>
<style lang="scss">
@import '@/assets/css/mine/coupdz.scss';
</style>
...@@ -112,6 +112,8 @@ export default { ...@@ -112,6 +112,8 @@ export default {
delCookie('Yo4teW_csrf'); delCookie('Yo4teW_csrf');
delCookie('Yo4teW_gid'); delCookie('Yo4teW_gid');
delCookie('Yo4teW_uid'); delCookie('Yo4teW_uid');
delCookie('Yo4teW_lskey');
delCookie('Yo4teW_skey');
}, },
methods: { methods: {
bindPickerChange: function(e) { bindPickerChange: function(e) {
...@@ -212,17 +214,17 @@ export default { ...@@ -212,17 +214,17 @@ export default {
this.request(Api_Url + '/login/action', 'POST', this.formParams, true, true).then(res => { this.request(Api_Url + '/login/action', 'POST', this.formParams, true, true).then(res => {
if (res.err_code === 0) { if (res.err_code === 0) {
delCookie('Yo4teW_csrf');
delCookie('Yo4teW_gid');
delCookie('Yo4teW_uid');
this.verify_flag = false; this.verify_flag = false;
uni.showToast({ uni.showToast({
title: '登录成功', title: '登录成功',
icon: 'success' icon: 'success'
}); });
setCookie('Yo4teW_csrf', res.data.cookie.Yo4teW_csrf, 7); setCookie('Yo4teW_csrf', res.data.cookie.Yo4teW_csrf, 15);
setCookie('Yo4teW_gid', res.data.cookie.Yo4teW_gid, 7); setCookie('Yo4teW_gid', res.data.cookie.Yo4teW_gid, 15);
setCookie('Yo4teW_uid', res.data.cookie.Yo4teW_uid, 7); setCookie('Yo4teW_uid', res.data.cookie.Yo4teW_uid, 15);
setCookie('Yo4teW_lskey', res.data.cookie.Yo4teW_lskey, 15);
setCookie('Yo4teW_skey', res.data.cookie.Yo4teW_skey, 15);
setTimeout(() => { setTimeout(() => {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
......
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
</view> </view>
<view class="info row verCenter"> <view class="info row verCenter">
<text class="t1">欢迎您,13800138000</text> <text class="t1">欢迎您,{{ userInfo.user_info.mobile }}</text>
<text class="t2 row rowCenter verCenter">个人</text> <text class="t2 row rowCenter verCenter">个人</text>
</view> </view>
<view class="company"><image src="../../static/company.png"></image></view> <view class="company"><image src="https://img.ichunt.com/images/ichunt/202305/19/8645c77def093657ad5ae66b4af6cad4.png"></image></view>
<view class="user-center"> <view class="user-center">
<navigator class="box column rowCenter verCenter" url="/userOrder" hover-class="none"> <navigator class="box column rowCenter verCenter" url="/userOrder" hover-class="none">
<image src="../../static/order.png"></image> <image src="../../static/order.png"></image>
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<view class="list-tool"> <view class="list-tool">
<view class="title">服务与工具</view> <view class="title">服务与工具</view>
<view class="list-tool-wrap"> <view class="list-tool-wrap">
<navigator class="box column rowCenter verCenter" url="/userAddress" hover-class="none"> <navigator class="box column rowCenter verCenter" url="/user/reciveaddress" hover-class="none">
<text class="iconfont icon-dzz"></text> <text class="iconfont icon-dzz"></text>
<text class="tt">地址管理</text> <text class="tt">地址管理</text>
</navigator> </navigator>
...@@ -73,10 +73,10 @@ ...@@ -73,10 +73,10 @@
<text class="iconfont icon-fpp"></text> <text class="iconfont icon-fpp"></text>
<text class="tt">发票管理</text> <text class="tt">发票管理</text>
</view> </view>
<view class="box column rowCenter verCenter"> <navigator class="box column rowCenter verCenter" url="/user/coupdz" hover-class="none">
<text class="iconfont icon-a-juxingbeifen142"></text> <text class="iconfont icon-a-juxingbeifen142"></text>
<text class="tt">京东卡</text> <text class="tt">京东卡</text>
</view> </navigator>
<view class="box column rowCenter verCenter"> <view class="box column rowCenter verCenter">
<text class="iconfont icon-a-juxingbeifen143"></text> <text class="iconfont icon-a-juxingbeifen143"></text>
<text class="tt">我的物料库</text> <text class="tt">我的物料库</text>
...@@ -116,7 +116,9 @@ export default { ...@@ -116,7 +116,9 @@ export default {
bottomNavFixed bottomNavFixed
}, },
data() { data() {
return {}; return {
userInfo: {}
};
}, },
onShow() { onShow() {
this.getData(); this.getData();
...@@ -124,8 +126,8 @@ export default { ...@@ -124,8 +126,8 @@ export default {
methods: { methods: {
getData() { getData() {
this.request(Api_Url + '/user/getUserType', 'POST', {}, true, true).then(res => { this.request(Api_Url + '/user/getUserType', 'POST', {}, true, true).then(res => {
console.log(res);
if (res.err_code === 0) { if (res.err_code === 0) {
this.userInfo = res.data;
} }
}); });
} }
......
...@@ -17,9 +17,32 @@ ...@@ -17,9 +17,32 @@
</view> </view>
<view class="p2">广东省深圳市龙岗区坂田清丽路1号宝能科技园南区12栋11楼</view> <view class="p2">广东省深圳市龙岗区坂田清丽路1号宝能科技园南区12栋11楼</view>
<view class="operate row bothSide verCenter"> <view class="operate row bothSide verCenter">
<view> <view class="row verCenter">
<view class="default"></view>
<text class="default-text">设为默认</text>
</view>
<view class="row verCenter">
<navigator class="edit row verCenter" url="/userAddressEdit" hover-class="none">
<text class="iconfont icon-bjt"></text>
<text class="tt">编辑</text>
</navigator>
<view class="delete row verCenter">
<text class="iconfont icon-del"></text>
<text class="tt">删除</text>
</view>
</view>
</view>
</view>
<view class="box">
<view class="p1 row verCenter">
<text class="t1">蔡先生</text>
<text class="t2">13800138000</text>
</view>
<view class="p2">广东省深圳市龙岗区坂田清丽路1号宝能科技园南区12栋11楼</view>
<view class="operate row bothSide verCenter">
<view class="row verCenter default-curr">
<view class="default"></view> <view class="default"></view>
<text class="default-text"></text> <text class="default-text">设为默认</text>
</view> </view>
<view class="row verCenter"> <view class="row verCenter">
<view class="edit row verCenter"> <view class="edit row verCenter">
...@@ -34,6 +57,16 @@ ...@@ -34,6 +57,16 @@
</view> </view>
</view> </view>
</view> </view>
<view class="no-data column rowCenter verCenter">
<image src="../../static/nodate.png"></image>
<text class="tt">暂无收货地址</text>
</view>
<view class="btn row verCenter">
<navigator class="btn1 row rowCenter verCenter" url="/userAddressAdd" hover-class="none">
<text class="iconfont icon-tj"></text>
<text class="text">新增地址</text>
</navigator>
</view>
</view> </view>
</template> </template>
......
<template>
<view class="page-userAddress">
<navElement title="新增地址"></navElement>
<view class="form-box">
<view class="input-box input row verCenter">
<text class="tt">收货人</text>
<input type="text" placeholder="请输入收货人" class="uni-input" />
</view>
<view class="input-box input row verCenter">
<text class="tt">手机号码</text>
<picker @change="bindPickerChange" :value="index" :range="array" class="intl_code">
<view class="row verCenter bothSide">
<view class="uni-input">{{ array[index] }}</view>
<view class="iconfont icon-arrbot"></view>
</view>
</picker>
<input type="number" placeholder="请输入手机号" class="uni-input" style="margin-left: 24rpx;" />
</view>
<view class="input-box input row verCenter">
<text class="tt">所在地区</text>
<picker @change="bindPickerChange" :value="index" :range="array" class="area">
<view class="row verCenter bothSide">
<view class="uni-input">省、市、区</view>
<view class="iconfont icon-arrbot"></view>
</view>
</picker>
</view>
<view class="input-box textarea row verCenter"><textarea placeholder="请输入详细街道地址"></textarea></view>
</view>
<view class="setting-default row verCenter bothSide">
<text class="tt">设为默认地址</text>
<view><switch checked style="transform:scale(0.7)" /></view>
</view>
<view class="btn row verCenter">
<view class="btn1 row rowCenter verCenter"><text class="text">保存地址</text></view>
</view>
</view>
</template>
<script>
import { Api_Url } from '@/util/api.js';
import navElement from '@/components/nav.vue';
export default {
components: {
navElement
},
data() {
return {
index: 0,
array: ['0086', '00886', '00853', '00852'],
formParams: {
intl_code: '86'
}
};
},
onLoad() {},
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
this.formParams.intl_code = this.array[e.detail.value];
}
}
};
</script>
<style lang="scss">
@import '@/assets/css/mine/userAddress.scss';
</style>
<template>
<view class="page-userAddress">
<navElement title="编辑地址">
<template slot="title-bar">
<view class="delete" style="font-size: 28rpx;color: #1969F9;text-align: right;">删除</view>
</template>
</navElement>
<view class="form-box">
<view class="input-box input row verCenter">
<text class="tt">收货人</text>
<input type="text" placeholder="请输入收货人" class="uni-input" />
</view>
<view class="input-box input row verCenter">
<text class="tt">手机号码</text>
<picker @change="bindPickerChange" :value="index" :range="array" class="intl_code">
<view class="row verCenter bothSide">
<view class="uni-input">{{ array[index] }}</view>
<view class="iconfont icon-arrbot"></view>
</view>
</picker>
<input type="number" placeholder="请输入手机号" class="uni-input" style="margin-left: 24rpx;" />
</view>
<view class="input-box input row verCenter">
<text class="tt">所在地区</text>
<picker @change="bindPickerChange" :value="index" :range="array" class="area">
<view class="row verCenter bothSide">
<view class="uni-input">省、市、区</view>
<view class="iconfont icon-arrbot"></view>
</view>
</picker>
</view>
<view class="input-box textarea row verCenter"><textarea placeholder="请输入详细街道地址"></textarea></view>
</view>
<view class="setting-default row verCenter bothSide">
<text class="tt">设为默认地址</text>
<view><switch checked style="transform:scale(0.7)" /></view>
</view>
<view class="btn row verCenter">
<view class="btn1 row rowCenter verCenter"><text class="text">保存修改</text></view>
</view>
</view>
</template>
<script>
import { Api_Url } from '@/util/api.js';
import navElement from '@/components/nav.vue';
export default {
components: {
navElement
},
data() {
return {
index: 0,
array: ['0086', '00886', '00853', '00852'],
formParams: {
intl_code: '86'
}
};
},
onLoad() {},
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
this.formParams.intl_code = this.array[e.detail.value];
}
}
};
</script>
<style lang="scss">
@import '@/assets/css/mine/userAddress.scss';
</style>
...@@ -5,9 +5,9 @@ import Router from 'uni-simple-router' ...@@ -5,9 +5,9 @@ import Router from 'uni-simple-router'
Vue.use(Router) Vue.use(Router)
//初始化 //初始化
const router = new Router({ const router = new Router({
h5:{ h5: {
loading: false, loading: false,
}, },
APP: { APP: {
animation: { animation: {
animationType: 'pop-in', animationType: 'pop-in',
...@@ -108,10 +108,31 @@ const router = new Router({ ...@@ -108,10 +108,31 @@ const router = new Router({
}, },
{ {
path: '/pages/mine/userAddress', path: '/pages/mine/userAddress',
aliasPath: '/userAddress', aliasPath: '/user/reciveaddress',
meta: { meta: {
title: '收货地址' title: '收货地址'
} }
},
{
path: '/pages/mine/userAddressAdd',
aliasPath: '/userAddressAdd',
meta: {
title: '新增地址'
}
},
{
path: '/pages/mine/userAddressEdit',
aliasPath: '/userAddressEdit',
meta: {
title: '编辑地址'
}
},
{
path: '/pages/mine/coupdz',
aliasPath: '/user/coupdz',
meta: {
title: '京东卡'
}
} }
] ]
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment