diff --git a/api/index.js b/api/index.js index 8e6a2fe..acdb4fd 100644 --- a/api/index.js +++ b/api/index.js @@ -9,8 +9,10 @@ export const defaultRequest =query=>{ errMsg:true, isCookies:false, isEncryption:false, + isLoad:true }) } + //默认请求地址 不显示错误信息 export const defaultRequest1 =query=>{ return httpRequest({ @@ -20,6 +22,7 @@ export const defaultRequest1 =query=>{ errMsg:false, isCookies:false, isEncryption:false, + isLoad:true }) } //默认请求地址 只用cookies请求数据 @@ -31,6 +34,7 @@ export const defaultRequest2 =query=>{ errMsg:true, isCookies:true, isEncryption:false, + isLoad:true }) } //默认请求地址 只用cookies请求数据 对立面的对象进行加密 @@ -42,5 +46,18 @@ export const defaultRequest3 =query=>{ errMsg:true, isCookies:true, isEncryption:true, + isLoad:true + }) +} +//默认请求地址 不显示等待加载 +export const defaultRequest4 =query=>{ + return httpRequest({ + url:'mapi/api_v2011.php?appcode=DOPE+', + method:'post', + data:query, + errMsg:true, + isCookies:false, + isEncryption:false, + isLoad:false }) } \ No newline at end of file diff --git a/api/request.js b/api/request.js index c5a6856..26b6a69 100644 --- a/api/request.js +++ b/api/request.js @@ -4,9 +4,12 @@ import Base64 from 'base-64'; import cryptoJS from "crypto-js" const httpRequest = (params) => { - uni.showLoading({ - title: "努力加载中..." - }); + if(params.isLoad){ + uni.showLoading({ + title: "努力加载中..." + }); + } + const json_data={ appcode:'DOPE+' ,//应用编码 appchannel:'FXXXXHUAWEI' ,//应用发布渠道 @@ -20,7 +23,6 @@ const httpRequest = (params) => { let data=Object.assign(json_data,params.data) console.info(data) let consignee - console.info(params.isEncryption) if(params.isEncryption){ // console.info(JSON.parse(JSON.stringify(data.consignee))) consignee=encryption(JSON.parse(JSON.stringify(data.consignee))) diff --git a/common/common.scss b/common/common.scss index 7a85711..3e949ef 100644 --- a/common/common.scss +++ b/common/common.scss @@ -371,6 +371,10 @@ height:340rpx ; background-color: #999999; margin-bottom: 37.33rpx; + image{ + width: 100%; + height: 100%; + } } .recommend_content_item_pric{ font-size: 32rpx; diff --git a/pages.json b/pages.json index e357f49..7a0d7c7 100644 --- a/pages.json +++ b/pages.json @@ -135,7 +135,8 @@ { "path": "pages/account/pointsDetails", "style": { - "titleNView":false + "titleNView":false, + "enablePullDownRefresh":true } }, { @@ -177,7 +178,8 @@ { "path": "pages/category/productList", "style": { - "titleNView":false + "titleNView":false, + "enablePullDownRefresh":true } }, { diff --git a/pages/account/addAddress.vue b/pages/account/addAddress.vue index 14cf17b..ef3006a 100644 --- a/pages/account/addAddress.vue +++ b/pages/account/addAddress.vue @@ -44,7 +44,7 @@ - + @@ -158,7 +158,7 @@ country:0, province:0, city:0, - district:1, + district:0, address:'', zipcode:'', email:'', @@ -170,17 +170,83 @@ is_default:0 }, province:'', - city:'' + city:'', + address:'' } }, methods:{ // save(){ + if(this.query.consignee.consignee==''){ + uni.showToast({ + icon:'none', + title:'Please fill Fall name' + }) + return + } + if(this.query.consignee.mobile==''){ + uni.showToast({ + icon:'none', + title:'Please fill Phone Number' + }) + return + } + if(this.address==''){ + uni.showToast({ + icon:'none', + title:'Please fill Stree adderss or P.O.Box' + }) + return + } + if(this.query.consignee.sign_building==''){ + uni.showToast({ + icon:'none', + title:'Please fill Appartment,suite,unit,etc.' + }) + return + } if(!this.isSelect1){ - this.query.consignee.address=this.city+this.query.consignee.address + if(this.city==''){ + uni.showToast({ + icon:'none', + title:'Please fill in City/Town' + }) + return + } + this.query.consignee.address=this.city+this.address + }else{ + if(this.query.consignee.city==0){ + uni.showToast({ + icon:'none', + title:'Please Select City/Town' + }) + return + } } if(!this.isSelect){ + if(this.province==''){ + uni.showToast({ + icon:'none', + title:'Please fill in State/Province' + }) + return + } this.query.consignee.address=this.province+this.query.consignee.address + }else{ + if(this.query.consignee.province==0){ + uni.showToast({ + icon:'none', + title:'Please Select State/Province' + }) + return + } + } + if(this.query.consignee.zipcode==''){ + uni.showToast({ + icon:'none', + title:'Please fill Zip code/Postcode/PLZ/Eircode' + }) + return } console.info(this.query) defaultRequest3(this.query).then(res=>{ @@ -192,6 +258,7 @@ }) uni.navigateBack() } + this.query.consignee.address='' }) }, // лǷĬϵַ @@ -207,7 +274,7 @@ getCountry(){ let data={_action:'getregions',parent_region_id:0} defaultRequest2(data).then(res=>{ - console.info(res) + // console.info(res) if(res.error==0){ this.countryList=res.data } @@ -215,6 +282,12 @@ }, // ѡ bindPickerChange(e){ + if(this.index!=e.detail.value){ + this.provinceText='' + this.cityText='' + this.query.consignee.city=0 + this.query.consignee.province=0 + } this.index=e.detail.value if(this.countryList[this.index].regions){ this.isSelect=true @@ -222,17 +295,18 @@ }else{ this.isSelect=false this.isSelect1=false - this.provinceText='' - this.cityText='' } + this.query.consignee.country=this.countryList[this.index].region_id this.countryText=this.countryList[this.index].region_name }, // ѡʡ bindPickerChange1(e){ - console.info(e.detail.value) + if(this.provinceIndex!=e.detail.value){ + this.cityText='' + this.query.consignee.city=0 + } this.provinceIndex=e.detail.value - if(this.provinceList[this.provinceIndex].regions){ this.isSelect1=true this.cityList=this.provinceList[this.provinceIndex].regions @@ -240,6 +314,7 @@ this.isSelect1=false this.cityText='' } + this.query.consignee.province=this.provinceList[this.provinceIndex].region_id this.provinceText=this.provinceList[this.provinceIndex].region_name }, @@ -250,7 +325,28 @@ this.cityText=this.cityList[this.cityIndex].region_name } }, - onLoad() { + onLoad(e) { + console.info(e) + if(e.type==1){ + e.data=JSON.parse(e.data) + this.query.consignee=e.data + this.address=this.query.consignee.address + if(e.data.default_address_id==e.data.address_id){ + this.query.is_default=1 + } + this.countryText=e.data.country_name + if(e.data.city!=0){ + this.isSelect1=true + this.cityText=e.data.city_name + }else{ + + } + if(e.data.province!=0){ + this.isSelect=true + this.provinceText=e.data.province_name + } + + } this.getCountry() } } diff --git a/pages/account/address.vue b/pages/account/address.vue index d59c6e6..54a8aee 100644 --- a/pages/account/address.vue +++ b/pages/account/address.vue @@ -11,16 +11,17 @@ {{item.sign_building}} {{item.country_name}} {{item.province_name}} {{item.city_name}} {{item.address}} {{item.mobile}} - + - + + Default address - Delete + Delete @@ -29,6 +30,10 @@ + + + @@ -37,10 +42,45 @@ export default { data() { return { - list:[] + list:[], + address_id:'' } }, methods:{ + // 修改地址 + updateAddress(item){ + uni.navigateTo({ + url:'./addAddress?type=1&data='+JSON.stringify(item) + }) + }, + // 删除地址 + deleteAddress(id){ + this.address_id=id + this.$refs.alertDialog.open() + }, + dialogConfirm(){ + let data={_action:'dropconsignee',address_id:this.address_id} + defaultRequest2(data).then(res=>{ + console.info(res) + if(res.error==0){ + uni.showToast({ + icon:'none', + title:res.message + }) + this.getList() + } + }) + }, + // 设置默认地址 + setDefault(id){ + let data={_action:'setdefaultconsignee',address_id:id} + defaultRequest2(data).then(res=>{ + console.info(res) + if(res.error==0){ + this.getList() + } + }) + }, getList(){ let data={_action:'getconsignees'} defaultRequest2(data).then(res=>{ diff --git a/pages/account/myProfile.vue b/pages/account/myProfile.vue index 0bd2e8b..ebfe401 100644 --- a/pages/account/myProfile.vue +++ b/pages/account/myProfile.vue @@ -35,7 +35,7 @@ Ship to - United States + {{addressDate.country_name || 'United States'}} @@ -57,10 +57,21 @@ query:{ _action:'updateinfo', nickname:'' - } + }, + addressDate:{} } }, methods:{ + // 获取默认地址 + getDefaultAddress(){ + let data={_action:'getdefaultconsignee'} + defaultRequest2(data).then(res=>{ + console.info(res) + if(res.error==0){ + this.addressDate=res.data + } + }) + }, getUserInfo(){ let data={_action:'getinfo'} defaultRequest2(data).then(res=>{ @@ -91,6 +102,7 @@ onLoad() { this.user_info=uni.getStorageSync('user_info') this.getUserInfo() + this.getDefaultAddress() } } diff --git a/pages/category/productList.vue b/pages/category/productList.vue index 7b9ecaa..4377e06 100644 --- a/pages/category/productList.vue +++ b/pages/category/productList.vue @@ -31,7 +31,7 @@ - + @@ -84,9 +84,12 @@ navWidth:"160rpx", query:{ _action:'getgoods', - order_type:0 + order_type:0, + page_index:1, + page_size:10 }, - list:[] + list:[], + isReachBottom:true } }, methods:{ @@ -158,16 +161,30 @@ this.query.order_type=1 } } - this.getList() + this.getList(0) }, - getList(){ + getList(type){ defaultRequest(this.query).then(res=>{ console.info(res) if(res.error==0){ - this.list=res.data - - this.$refs.waterfallsFlowRef.refresh(); + if(res.data){ + if(type==0){ + this.list=res.data + this.$refs.waterfallsFlowRef.refresh(); + }else{ + this.list=this.list.concat(res.data) + } + + }else{ + this.isReachBottom=false + uni.showToast({ + title: 'No more data yet', + icon:'none' + }) + this.query.page_index-- + } } + uni.hideNavigationBarLoading(); }) } }, @@ -177,8 +194,13 @@ }else{ this.query.keyword=e.keyword } - this.getList() - + this.getList(0) + }, + // 上拉加载 + onReachBottom(){ + if(!this.isReachBottom)return + this.query.page_index++ + this.getList(1) } } diff --git a/pages/productDetails/index.vue b/pages/productDetails/index.vue index 5301201..c7885ec 100644 --- a/pages/productDetails/index.vue +++ b/pages/productDetails/index.vue @@ -3,7 +3,10 @@ - + + + + @@ -66,30 +69,33 @@ {{goodsDate.goods_name}} - - 4.0 + + {{goodsDate.comment_summary[0].commentcount==0?'0.0':'4.0'}} ({{goodsDate.comment_summary[0].commentcount}}reviews) Variations - 2color + {{colorNum}}color - - - - - 34 - 35 - M - L + + + + {{item1.attr_value}} + + + - + Promotion @@ -110,7 +116,7 @@ - Shipping to United States + Shipping to {{addressDate.country_name || 'United States'}} @@ -148,8 +154,8 @@
  • Safe Payments
    • -
    • Safe Payments
    • -
    • Safe Payments
    • +
    • Secure Logistics
    • +
    • Secure Logistics
    @@ -158,7 +164,8 @@ Description
    - #Iron #Pearls,Flowers #Fashionable + + {{goodsDate.tags}}
    @@ -167,7 +174,7 @@ - Reviews(24) + Reviews({{goodsDate.comment_summary[0].commentcount}}) @@ -175,30 +182,37 @@ - 4.0 - + {{goodsDate.comment_summary[0].commentcount==0?'0.0':'4.0'}} + - - - - - e***8 - + + Product lmage gallery - - + + + + + Other options @@ -209,14 +223,18 @@ - + + + You might also like - - - Adidas Yeezy Boost 350 DazzlingBlue Black - US$314.00 + + + + + {{item.short_name}} + US${{item.is_promote==0? item.shop_price :item.promote_price}} @@ -266,22 +284,33 @@ - + - Adidas Yeezy Boost 350 V2 Dazzling Blue Black GY 7164 Men's Sizes - US$314.00 - Color Family - - - - + {{goodsDate.goods_name}} + US${{goodsDate.is_promote==0? goodsDate.shop_price :goodsDate.promote_price}} + + {{item.attr_name}} + + + + {{item1.attr_value}} - - 021【Blue】 + - Size + + Quantity 1 @@ -302,7 +331,7 @@ @@ -411,6 +545,11 @@