From 955ea2fdeeb257d19dd72c888f95a4216dc2766a Mon Sep 17 00:00:00 2001
From: hejinfu1026 <18537720348@163.com>
Date: Mon, 15 Nov 2021 10:16:11 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B=E7=BC=BA?=
=?UTF-8?q?=E9=99=B7=EF=BC=8C=E6=9B=B4=E6=8D=A2tabbar=E7=B4=A0=E6=9D=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.hbuilderx/launch.json | 19 ++-
components/userEvaluation/index.vue | 5 +-
config/app.js | 2 +-
manifest.json | 8 +-
.../goods_combination_details/index.vue | 19 ++-
.../activity/goods_seckill_details/index.vue | 44 +++++--
pages/goods_details/index.vue | 61 ++++++----
pages/users/user_address/index.vue | 110 ++++++++---------
static/html/pc.html | 16 +--
static/images/1-001.png | Bin 2118 -> 1946 bytes
static/images/1-002.png | Bin 2467 -> 1690 bytes
static/images/2-001.png | Bin 2064 -> 1519 bytes
static/images/2-002.png | Bin 2231 -> 1417 bytes
static/images/3-001.png | Bin 2230 -> 2133 bytes
static/images/3-002.png | Bin 2106 -> 1899 bytes
static/images/4-001.png | Bin 2006 -> 2482 bytes
static/images/4-002.png | Bin 2096 -> 2016 bytes
utils/cache.js | 113 ++++++++++++++++--
utils/util.js | 24 ++++
19 files changed, 284 insertions(+), 137 deletions(-)
diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json
index 501e01c8..075b9c55 100644
--- a/.hbuilderx/launch.json
+++ b/.hbuilderx/launch.json
@@ -2,10 +2,19 @@
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
- "type": "uniCloud",
- "default": {
- "launchtype": "remote"
- }
- }
+ "default" :
+ {
+ "launchtype" : "remote"
+ },
+ "h5" :
+ {
+ "launchtype" : "remote"
+ },
+ "mp-weixin" :
+ {
+ "launchtype" : "remote"
+ },
+ "type" : "uniCloud"
+ }
]
}
diff --git a/components/userEvaluation/index.vue b/components/userEvaluation/index.vue
index a01cc37a..dabc11ce 100644
--- a/components/userEvaluation/index.vue
+++ b/components/userEvaluation/index.vue
@@ -1,6 +1,5 @@
-
-
+
@@ -39,7 +38,7 @@
props: {
reply: {
type: Array,
- default: () => []
+ default: []
}
},
data: function() {
diff --git a/config/app.js b/config/app.js
index 4ce20d41..73eb1968 100644
--- a/config/app.js
+++ b/config/app.js
@@ -1,5 +1,5 @@
-let domain = 'http://127.0.0.1:8080'
+let domain = 'https://api.dev.java.crmeb.net/'
module.exports = {
// 请求域名 格式: https://您的域名
diff --git a/manifest.json b/manifest.json
index b3ab4916..d3a70029 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,6 +1,6 @@
{
"name" : "crmeb",
- "appid" : "__UNI__66E0853",
+ "appid" : "__UNI__E8BDBA5",
"description" : "crmeb商城",
"versionName" : "1.0.0",
"versionCode" : 1001,
@@ -99,11 +99,7 @@
},
"domain" : "",
"sdkConfigs" : {
- "maps" : {
- "qqmap" : {
- "key" : "map key"
- }
- }
+ "maps" : {}
},
"optimization" : {
"treeShaking" : {
diff --git a/pages/activity/goods_combination_details/index.vue b/pages/activity/goods_combination_details/index.vue
index e289b219..8fc2bc63 100644
--- a/pages/activity/goods_combination_details/index.vue
+++ b/pages/activity/goods_combination_details/index.vue
@@ -276,6 +276,7 @@
import {
getProductCode
} from '@/api/store.js'
+ import { spread } from "@/api/user";
export default {
components: {
shareRedPackets,
@@ -417,18 +418,27 @@
},
});
if (options.hasOwnProperty('id') || options.scene) {
- options.scene ? this.id = app.globalData.id : this.id = options.id;
- // app.globalData.openPages = '/pages/activity/goods_combination_details/index?id=' + this.id + '&spid=' + this.userInfo.uid;
+ if (options.scene) { // 仅仅小程序扫码进入
+ let qrCodeValue = this.$util.getUrlParams(decodeURIComponent(options.scene));
+ let mapeMpQrCodeValue = this.$util.formatMpQrCodeData(qrCodeValue);
+ app.globalData.spread = mapeMpQrCodeValue.spread;
+ this.id = mapeMpQrCodeValue.id;
+ setTimeout(()=>{
+ spread(mapeMpQrCodeValue.spread).then(res => {}).catch(res => {})
+ },2000)
+ }else{
+ this.id = options.id;
+ }
if (this.isLogin) {
this.combinationDetail();
} else {
- // #ifdef H5
+ // #ifdef H5 || APP-PLUS
try {
uni.setStorageSync('comGoodsId', options.id);
} catch (e) {}
// #endif
this.$Cache.set('login_back_url',
- `/pages/activity/goods_combination_details/index?id=${options.id}&spid=${options.spid?options.spid:0}`
+ `/pages/activity/goods_combination_details/index?id=${options.id}&spread=${options.pid?options.pid:0}`
);
toLogin();
}
@@ -448,7 +458,6 @@
})
}
};
- this.isLogin && silenceBindingSpread();
},
methods: {
getProductReplyCount: function() {
diff --git a/pages/activity/goods_seckill_details/index.vue b/pages/activity/goods_seckill_details/index.vue
index 59eed1b0..0f9c020d 100644
--- a/pages/activity/goods_seckill_details/index.vue
+++ b/pages/activity/goods_seckill_details/index.vue
@@ -112,7 +112,6 @@
-
@@ -200,6 +199,7 @@
toLogin
} from '@/libs/login.js';
import { silenceBindingSpread } from "@/utils";
+ import { spread } from "@/api/user";
export default {
data() {
return {
@@ -311,7 +311,7 @@
}
},
onLoad(options) {
- let that = this
+ let that = this;
that.$store.commit("PRODUCT_TYPE", 'normal');
let statusBarHeight = '';
var pages = getCurrentPages();
@@ -330,16 +330,38 @@
let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
this.meunHeight = menuButtonInfo.height
this.backH = (that.navH / 2) + (this.meunHeight / 2)
-
+ setTimeout(()=>{
+ if(options.spread){
+ app.globalData.spread = options.spread;
+ spread(options.spread).then(res => {})
+ }
+ },2000)
+ if (!options.scene && !options.id){
+ this.showSkeleton = false;
+ this.$util.Tips({
+ title: '缺少参数无法查看商品'
+ }, {
+ url: '/pages/index/index'
+ });
+ return;
+ }
+ if (options.hasOwnProperty('id') || options.scene){
+ if (options.scene) { // 仅仅小程序扫码进入
+ let qrCodeValue = this.$util.getUrlParams(decodeURIComponent(options.scene));
+ let mapeMpQrCodeValue = this.$util.formatMpQrCodeData(qrCodeValue);
+ app.globalData.spread = mapeMpQrCodeValue.spread;
+ this.id = mapeMpQrCodeValue.id;
+ setTimeout(()=>{
+ spread(mapeMpQrCodeValue.spread).then(res => {}).catch(res => {})
+ },2000)
+ }else{
+ this.id = options.id;
+ }
+ }
// #endif
- if (!options.scene && options.id == 'undefined') return this.$util.Tips({
- title: '缺少参数无法查看商品'
- }, {
- tab: 3,
- url: 1
- });
- options.scene ? this.id = app.globalData.id : this.id = options.id;
+
if (this.isLogin) {
+ this.id = options.id;
this.getSeckillDetail();
} else {
this.$Cache.set('login_back_url',
@@ -372,7 +394,7 @@
limit: 3,
type: 0,
}).then(res => {
- this.reply = res.data.list ? [res.data.list[0]] : [];
+ this.reply = res.data.list;
})
},
getProductReplyCount: function() {
diff --git a/pages/goods_details/index.vue b/pages/goods_details/index.vue
index 394b6b60..4bb35ab9 100644
--- a/pages/goods_details/index.vue
+++ b/pages/goods_details/index.vue
@@ -269,6 +269,7 @@
getProductGood,
getReplyProduct
} from '@/api/store.js';
+ import { spread } from "@/api/user";
import {
getCoupons
} from '@/api/api.js';
@@ -425,38 +426,48 @@
if (pages.length <= 1) {
that.retunTop = false
}
- // #ifdef MP
that.navH = app.globalData.navHeight;
+ // #ifdef MP || APP-PLUS
+ // 小程序链接进入获取绑定关系id
+ setTimeout(()=>{
+ if(options.spread){
+ app.globalData.spread = options.spread;
+ spread(options.spread).then(res => {})
+ }
+ },2000)
// #endif
- // #ifndef MP
- that.navH = 96;
- // #endif
- if (options.id == 'undefined') {
- that.id = 0
- } else {
- that.id = options.id;
+ uni.getSystemInfo({
+ success: function(res) {
+ that.height = res.windowHeight;
+ },
+ });
+ if (!options.scene && !options.id) {
+ this.showSkeleton = false;
+ this.$util.Tips({
+ title: '缺少参数无法查看商品'
+ }, {
+ url: '/pages/index/index'
+ });
+ return;
+ }
+ if (options.hasOwnProperty('id') || options.scene) {
+ if (options.scene) { // 仅仅小程序扫码进入
+ let qrCodeValue = that.$util.getUrlParams(decodeURIComponent(options.scene));
+ let mapeMpQrCodeValue = that.$util.formatMpQrCodeData(qrCodeValue);
+ app.globalData.spread = mapeMpQrCodeValue.spread;
+ this.id = mapeMpQrCodeValue.id;
+ setTimeout(()=>{
+ spread(mapeMpQrCodeValue.spread).then(res => {}).catch(res => {})
+ },2000)
+
+ } else {
+ this.id = options.id;
+ }
options.type == undefined || options.type == null ? that.type = 'normal' : that.type = options.type;
that.$store.commit("PRODUCT_TYPE", that.type);
}
- uni.getSystemInfo({
- success: function(res) {
- that.height = res.windowHeight
- //res.windowHeight:获取整个窗口高度为px,*2为rpx;98为头部占据的高度;
- },
- });
- //扫码携带参数处理
- // #ifdef MP
- if (!options.scene && options.id == 'undefined') return this.$util.Tips({
- title: '缺少参数无法查看商品'
- }, {
- tab: 3,
- url: 1
- });
- options.scene ? this.id = app.globalData.id : this.id = options.id;
- // #endif
this.getGoodsDetails();
this.getCouponList();
- this.isLogin && silenceBindingSpread();
this.getProductReplyList();
this.getProductReplyCount();
this.getGoods();
diff --git a/pages/users/user_address/index.vue b/pages/users/user_address/index.vue
index 68d8d56e..ec7dd967 100644
--- a/pages/users/user_address/index.vue
+++ b/pages/users/user_address/index.vue
@@ -6,29 +6,30 @@
姓名
+ placeholder-class='placeholder' maxlength="4">
联系电话
-
+
-
+
所在地区
{{region[0]}},{{region[1]}},{{region[2]}}
-
+
-
+
详细地址
+ v-model='userAddress.detail' maxlength="18">
+
@@ -49,7 +50,7 @@
-
+
@@ -67,12 +68,12 @@
import {
mapGetters
} from "vuex";
- import wPicker from "@/components/wPicker/w-picker.vue";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
// import city from '@/utils/cityData';
+ let app = getApp();
export default {
components: {
// #ifdef MP
@@ -102,7 +103,7 @@
defaultRegionCode: '440113',
bargain: false, //是否是砍价
combination: false, //是否是拼团
- secKill: false //是否是秒杀
+ secKill: false, //是否是秒杀
};
},
computed: mapGetters(['isLogin']),
@@ -120,39 +121,42 @@
onLoad(options) {
if (this.isLogin) {
this.preOrderNo = options.preOrderNo || 0;
- // this.cartId = options.cartId || '';
- // this.pinkId = options.pinkId || 0;
- // this.couponId = options.couponId || 0;
this.id = options.id || 0;
- // this.secKill = options.secKill || false;
- // this.combination = options.combination || false;
- // this.bargain = options.bargain || false;
uni.setNavigationBarTitle({
title: options.id ? '修改地址' : '添加地址'
})
this.getUserAddress();
- this.getCityList();
- // if(this.district && this.district.length){
- // this.initialize();
- // }
+ if(this.$Cache.has('cityList')){
+ //检测城市数据是否存在缓存,有的话从缓存取,没有的话请求接口
+ this.district = this.$Cache.getItem('cityList')
+ this.initialize();
+ }else{
+ this.getCityList();
+ }
} else {
toLogin();
}
},
methods: {
- // 回去地址数据
+ // #ifdef APP-PLUS
+ // 获取选择的地区
+ handleGetRegion(region) {
+ this.region = region
+ },
+ // #endif
+ // 获取地址数据
getCityList: function() {
let that = this;
getCity().then(res => {
- this.district = res.data
+ this.district = res.data;
+ let oneDay = 24 * 3600 * 1000;
+ // this.$Cache.set('cityList', JSON.stringify(res.data)); //设置不过期时间的方法
+ this.$Cache.setItem({name:'cityList',value:res.data,expires:oneDay * 7}); //设置七天过期时间
that.initialize();
})
},
initialize: function() {
- let that = this,
- province = [],
- city = [],
- area = [];
+ let that = this,province = [],city = [],area = [];
if (that.district.length) {
let cityChildren = that.district[0].child || [];
let areaChildren = cityChildren.length ? (cityChildren[0].child || []) : [];
@@ -216,7 +220,7 @@
break;
}
- // #ifdef MP
+ // #ifdef MP || APP-PLUS
this.$set(this.multiArray, 0, multiArray[0]);
this.$set(this.multiArray, 1, multiArray[1]);
this.$set(this.multiArray, 2, multiArray[2]);
@@ -224,9 +228,6 @@
// #ifdef H5
this.multiArray = multiArray;
// #endif
-
-
-
this.multiIndex = multiIndex
// this.setData({ multiArray: multiArray, multiIndex: multiIndex});
},
@@ -254,6 +255,13 @@
that.city_id = res.data.cityId
});
},
+ chooseLocation: function () {
+ uni.chooseLocation({
+ success: (res) => {
+ this.$set(this.userAddress,'detail',res.address.replace(/.+?(省|市|自治区|自治州|县|区)/g,''));
+ }
+ })
+ },
// 导入共享地址(小程序)
getWxAddress: function() {
let that = this;
@@ -456,9 +464,7 @@
setTimeout(function() {
if (that.preOrderNo>0) {
uni.redirectTo({
- url: '/pages/users/order_confirm/index?preOrderNo=' + that
- .preOrderNo + '&addressId=' + (that.id ? that.id : res.data
- .id)
+ url: '/pages/users/order_confirm/index?preOrderNo=' + that.preOrderNo + '&addressId=' + (that.id ? that.id : res.data.id)
})
} else {
// #ifdef H5
@@ -469,29 +475,7 @@
delta: 1,
})
// #endif
-
}
-
- // if (that.cartId) {
- // let cartId = that.cartId;
- // let pinkId = that.pinkId;
- // let couponId = that.couponId;
- // that.cartId = '';
- // that.pinkId = '';
- // that.couponId = '';
- // uni.navigateTo({
- // url: '/pages/users/order_confirm/index?cartId=' + cartId + '&addressId=' + (that.id ? that.id : res.data.id) +'&pinkId=' + pinkId + '&couponId=' + couponId + '&secKill=' + that.secKill + '&combination=' + that.combination + '&bargain=' + that.bargain
- // });
- // } else {
- // // #ifdef H5
- // return history.back();
- // // #endif
- // // #ifndef H5
- // return uni.navigateBack({
- // delta: 1,
- // })
- // // #endif
- // }
}, 1000);
}).catch(err => {
return that.$util.Tips({
@@ -510,7 +494,6 @@
.addAddress {
padding-top: 20rpx;
}
-
.addAddress .list {
background-color: #fff;
padding: 0 24rpx;
@@ -548,10 +531,6 @@
font-size: 30rpx;
}
- .addAddress .list .item picker .iconfont {
- font-size: 43rpx;
- }
-
.addAddress .default {
padding: 0 30rpx;
height: 90rpx;
@@ -585,4 +564,15 @@
color: #E93323 ;
border: 1px solid #E93323;
}
+ .relative{
+ position: relative;
+ }
+ .icon-dizhi{
+ font-size: 44rpx;
+ z-index: 100;
+ }
+ .abs_right{
+ position: absolute;
+ right:0;
+ }
diff --git a/static/html/pc.html b/static/html/pc.html
index 8450d453..7148bd20 100644
--- a/static/html/pc.html
+++ b/static/html/pc.html
@@ -18,7 +18,8 @@
width: 375px;
height: 667px;
background-color: #fff;
- box-sizing: content-box;
+ /* box-sizing: content-box; */
+ box-sizing: border-box;
border: none;
}
@@ -39,20 +40,15 @@
window.isPC = true;
window.onload = function(){
/* 监听电脑浏览器窗口尺寸改变 */
- window.onresize = function(){
- /* 窗口宽度 小于或等于420px 时,跳转回H5页面 */
- if(window.innerWidth <= 420){
- // window.location.pathname = 'https://java.crmeb.net/';
- /* 若你的项目未设置根目录(默认为 / 时),则使用下方代码 */
- window.location.pathname = '';
- }
- }
+ if(window.innerWidth <= 420){
+ window.location.pathname = '/';
+ }
}
-
+