Browse Source

优化部分内容、新增选择头像

master
ltlzx 4 years ago
parent
commit
a277f4471f
  1. 8
      pages.json
  2. 165
      pages/account/changeImg.vue
  3. 11
      pages/account/favorites.vue
  4. 16
      pages/account/index.vue
  5. 32
      pages/account/myOrders.vue
  6. 10
      pages/account/myProfile.vue
  7. 43
      pages/account/wishlist.vue
  8. 2
      pages/index/index.vue
  9. 2
      pages/index/search.vue
  10. 2
      pages/order/details.vue
  11. 5
      pages/shippingCart/index.vue
  12. BIN
      static/icon/left.png

8
pages.json

@ -47,6 +47,14 @@
"navigationBarBackgroundColor":"#FFFFFF" "navigationBarBackgroundColor":"#FFFFFF"
} }
}, },
{
"path" : "pages/account/changeImg",
"style" :{
"navigationStyle":"custom",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/account/wishlist", "path": "pages/account/wishlist",
"style": { "style": {

165
pages/account/changeImg.vue

@ -0,0 +1,165 @@
<template>
<view>
<view class="foot fixed">
<uni-section title="左侧文字+右侧文字" subTitle="使用 left-text/right-text 设置左右文字" type="line"
style="margin-bottom: 3px;">
<view class="box-bg">
<uni-nav-bar border="false" title="标题" >
<block slot="left">
<!-- <view ><uni-icons type="back" size="30"></uni-icons></view> -->
<view class="icon-all"><image class="imgsize"src='../../static/icon/left.png'/></view>
</block>
<block slot="right">
<view class="text-bg" @click="Sub()">submit</view>
</block>
</uni-nav-bar>
</view>
</uni-section>
</view>
<view class="detail">
<view class="contain" v-for="(item,index) in imglist" :key="index">
<!-- <view class="icon imgsize" :style="{backgroundImage :'url(' + item +')'}"></view> -->
<view class="icon" @click="tabActive(index,item)">
<image class="imgsize":src="item"></image>
<radio class="main-icon-radio" v-show="current>0" :checked="index == current?true:false" />
</view>
</view>
</view>
</view>
</template>
<script>
import {defaultRequest} from '../../api/index.js'
export default {
data() {
return {
current:-1,
active_img:'',
query:{
_action:'getinfo'
},
query2:{
_action:'updateinfo',
nickname:'',
sex:'',
birthday:'',
user_head:'',
email:''
},
imglist:[]
}
},
onLoad() {
this.getimglist()
},
methods: {
getimglist(){
defaultRequest(this.query).then(res =>
{
// console.log(res.data.headicons,'')
this.imglist = res.data.headicons
console.log(res.data)
this.query2.nickname = res.data.nickname
// for(let i of this.imglist)
// console.log(i)
})
},
tabActive(index,item){
this.current = index
console.log(index)
this.active_img = item
},
//
Sub(){
console.log( this.active_img,'选择的图片')
this.query2.user_head = this.active_img;
defaultRequest(this.query2).then( res => {
console.log(res,'yyyy')
if(res.error==0){
uni.showToast({
title:'succuss',
duration: 2000,
icon:'none'
})
uni.navigateBack({
delta:1
})
}
})
},
}
}
</script>
<style>
.foot{
height:120rpx;
width: 100vw;
padding:50rpx 0 0 0;
background-color: #fff;
position: fixed;
}
.fixed{
position: fixed;
z-index: 99;
}
.icon-all{
height: 30rpx;
width:30rpx ;
}
.detail{
display: flex;
flex-wrap: wrap;
margin:10rpx 50rpx 10rpx 50rpx;
padding: 100rpx 0;
background-color: #fff;
}
.text-bg{
background-color: black;
color: aliceblue;
padding: 6rpx 10rpx;
border-radius: 15rpx;
}
.contain{
width: 180rpx;
height: 160rpx;
display: flex;
flex-direction: column;
margin: 50rpx 10rpx 10rpx 10rpx;
padding: 10rpx;
position: relative;
justify-content: center;
align-items: center;
}
.icon{
height: 160rpx;
width:160rpx;
margin: 12rpx;
display: flex;
justify-content: flex-end;
position: absolute;
align-items: center;
}
.imgsize{
width: 100%;
height: 100%;
}
.main-icon-radio {
position: absolute;
z-index: 9;
margin-top: 110rpx;
margin-left: 20rpx;
}
</style>

11
pages/account/favorites.vue

@ -3,15 +3,15 @@
<view class="status_bar"></view> <view class="status_bar"></view>
<uni-nav-bar left-icon="left" :rightText="isDelete?'Done':'Delete'" title="Favorites" color="#000000" @clickLeft="back" @clickRight="$refs.alertDialog.open()"/> <uni-nav-bar left-icon="left" :rightText="isDelete?'Done':'Delete'" title="Favorites" color="#000000" @clickLeft="back" @clickRight="$refs.alertDialog.open()"/>
<view class="wishlist"> <view class="wishlist">
<view class="wishlist_item" v-for="(item,index) in goodsList" :key="index" > <view class="wishlist_item" v-for="(item,index) in goodsList" :key="index" @click="goDetails(item.goods_id)">
<view class="wishlist_item_img"> <view class="wishlist_item_img">
<image :src="item.goods_img" mode="" class="wishlist_item_img_goods"></image> <image :src="item.goods_img" mode="" class="wishlist_item_img_goods"></image>
<image src="../../static/img/select.png" mode="" class="select" v-show="isDelete"></image> <image src="../../static/img/select.png" mode="" class="select" v-show="isDelete"></image>
</view> </view>
<view class="wishlist_item_bottom"> <view class="wishlist_item_bottom">
<text>US${{item.promote_price?item.promote_price:item.shop_price}}</text> <text>US${{item.promote_price?item.promote_price:item.shop_price}}</text>
<image src="/static/img/like.png" mode="" v-show="item.is_attention==0" class="wishlist_item_bottom_icon" @click="addLike(item.id)"></image> <image src="/static/img/like.png" mode="" v-show="item.is_attention==0" class="wishlist_item_bottom_icon" @click.stop="addLike(item.id)"></image>
<image src="../../static/img/like1.png" mode="" v-show="item.is_attention==1" class="wishlist_item_bottom_icon" @click="removeLike(item.id)"></image> <image src="../../static/img/like1.png" mode="" v-show="item.is_attention==1" class="wishlist_item_bottom_icon" @click.stop="removeLike(item.id)"></image>
</view> </view>
</view> </view>
</view> </view>
@ -41,6 +41,11 @@
} }
}, },
methods:{ methods:{
goDetails(id){
uni.navigateTo({
url:"../productDetails/index?goods_id="+id
})
},
// //
clearFavorites(){ clearFavorites(){
let data={_action:'cleargoodsbrowsehistory'} let data={_action:'cleargoodsbrowsehistory'}

16
pages/account/index.vue

@ -37,24 +37,24 @@
</view> </view>
<view class="order"> <view class="order">
<view class="order_title">My Orders</view> <navigator url="/pages/account/myOrders?scroll_active=0" class="order_title">My Orders</navigator>
<view class="order_info"> <view class="order_info">
<navigator url="/pages/account/myOrders" class="order_info_item"> <navigator url="/pages/account/myOrders?scroll_active=1" class="order_info_item">
<image src="../../static/img/unpaid.png" mode="" class="info_img"></image> <image src="../../static/img/unpaid.png" mode="" class="info_img"></image>
<text>Unpaid</text> <text>Unpaid</text>
</navigator> </navigator>
<view class="order_info_item"> <navigator url="/pages/account/myOrders?scroll_active=2" class="order_info_item">
<image src="../../static/img/Processing.png" mode="" class="info_img"></image> <image src="../../static/img/Processing.png" mode="" class="info_img"></image>
<text>Processing</text> <text>Processing</text>
</view> </navigator>
<view class="order_info_item"> <navigator url="/pages/account/myOrders?scroll_active=3" class="order_info_item">
<image src="../../static/img/Shipped.png" class="info_img" mode=""></image> <image src="../../static/img/Shipped.png" class="info_img" mode=""></image>
<text>Shipped</text> <text>Shipped</text>
</view> </navigator>
<view class="order_info_item"> <navigator url="/pages/account/myOrders?scroll_active=4" class="order_info_item">
<image src="../../static/img/Returns.png" class="info_img" mode=""></image> <image src="../../static/img/Returns.png" class="info_img" mode=""></image>
<text>Returns</text> <text>Returns</text>
</view> </navigator>
</view> </view>
</view> </view>

32
pages/account/myOrders.vue

@ -150,12 +150,14 @@
</view> </view>
</view> </view>
</template> </template>
<!-- 待发货订单 --> <!-- 待发货订单 -->
<template v-if="isList==true && scroll_active==2"> <template v-if="isList==true && scroll_active==2">
<view v-for="(item,idnex) in orderList" :key="item.order_id"> <view v-for="(item,idnex) in orderList" :key="item.order_id">
<view class="order" v-if="item.pay_status_code==2 && item.shipping_status_code==0" @click="goDetails(0,item.order_id)"> <view class="order" v-if="item.pay_status_code==2 && item.shipping_status_code==0" @click="goDetails(item,item.order_id)">
<view class="order_title"> <view class="order_title">
<text>To be shipped</text> <text>To be shipped</text>
<view class="order_title_right"> <view class="order_title_right">
@ -200,11 +202,13 @@
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<!-- 运输中订单 --> <!-- 运输中订单 -->
<template v-if="isList==true && scroll_active==3"> <template v-if="isList==true && scroll_active==3">
<view v-for="(item,idnex) in orderList" :key="item.order_id"> <view v-for="(item,idnex) in orderList" :key="item.order_id">
<view class="order" v-if="item.pay_status_code==2 && item.shipping_status_code==1 || item.shipping_status_code==4" @click="goDetails(4,item.order_id)"> <view class="order" v-if="item.pay_status_code==2 && item.shipping_status_code==1 || item.shipping_status_code==4" @click="goDetails(item,item.order_id)">
<view class="order_title"> <view class="order_title">
<text>Shipped</text> <text>Shipped</text>
<view class="order_title_right"> <view class="order_title_right">
@ -253,11 +257,13 @@
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<!-- 已完成订单 --> <!-- 已完成订单 -->
<template v-if="isList==true && scroll_active==4"> <template v-if="isList==true && scroll_active==5">
<view class="" v-for="(item,idnex) in orderList" :key="item.order_id"> <view class="" v-for="(item,idnex) in orderList" :key="item.order_id">
<view class="order " v-if="item.pay_status_code==2 && item.shipping_status_code==2" @click="goDetails(2,item.order_id)"> <view class="order " v-if="item.pay_status_code==2 && item.shipping_status_code==2" @click="goDetails(item,item.order_id)">
<view class="order_title"> <view class="order_title">
<text>Completed</text> <text>Completed</text>
<view class="order_title_right"> <view class="order_title_right">
@ -307,11 +313,13 @@
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<!-- 退换货订单 --> <!-- 退换货订单 -->
<template v-if="isList==true && scroll_active==5"> <template v-if="isList==true && scroll_active==4">
<view class="" v-for="(item,idnex) in orderList" :key="item.order_id"> <view class="" v-for="(item,idnex) in orderList" :key="item.order_id">
<view class="order" v-if="item.order_status_code==4" @click="goDetails(2,item.order_id)"> <view class="order" v-if="item.order_status_code==4" @click="goDetails(item,item.order_id)">
<view class="order_title"> <view class="order_title">
<text>Return and exchange</text> <text>Return and exchange</text>
<view class="order_title_right"> <view class="order_title_right">
@ -359,11 +367,13 @@
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<!-- 已取消订单 --> <!-- 已取消订单 -->
<template v-if="isList==true && scroll_active==6"> <template v-if="isList==true && scroll_active==6">
<view class="" v-for="(item,idnex) in orderList" :key="item.order_id"> <view class="" v-for="(item,idnex) in orderList" :key="item.order_id">
<view class="order" v-if="item.order_status_code==2" @click="goDetails(1,item.order_id)"> <view class="order" v-if="item.order_status_code==2" @click="goDetails(item,item.order_id)">
<view class="order_title"> <view class="order_title">
<text>cancelled</text> <text>cancelled</text>
<view class="order_title_right"> <view class="order_title_right">
@ -411,6 +421,8 @@
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<template v-if="isList==false"> <template v-if="isList==false">
<view class="order1"> <view class="order1">
@ -578,6 +590,7 @@
// 退 // 退
index=5 index=5
} }
let url='../order/details?details_index='+index+'&id='+id let url='../order/details?details_index='+index+'&id='+id
if(index==5){ if(index==5){
url='../order/refundDetails' url='../order/refundDetails'
@ -659,7 +672,7 @@
defaultRequest2(this.query).then(res=>{ defaultRequest2(this.query).then(res=>{
console.info(res) console.info(res)
if(res.error==0){ if(res.error==0){
this.orderList=res.data if(res.data) this.orderList=res.data
if(this.orderList.length==0){ if(this.orderList.length==0){
this.isList=false this.isList=false
}else{ }else{
@ -685,6 +698,9 @@
onShow() { onShow() {
this.getList() this.getList()
}, },
onLoad(e) {
this.scroll_active=e.scroll_active
},
filters:{ filters:{
goodsAttr(e){ goodsAttr(e){
return e.replace(/\s\n/g,';'); return e.replace(/\s\n/g,';');

10
pages/account/myProfile.vue

@ -1,7 +1,7 @@
<template> <template>
<view> <view>
<view class="profile_item profile_item1"> <view class="profile_item profile_item1" @click="gotochange">
<text>Photo</text> <text>Photo</text>
<view class="profile_item_right"> <view class="profile_item_right">
<image src="../../static/img/logo.png" mode="" class="head_img" v-show="!user_info.isLogin"></image> <image src="../../static/img/logo.png" mode="" class="head_img" v-show="!user_info.isLogin"></image>
@ -62,6 +62,12 @@
} }
}, },
methods:{ methods:{
//
gotochange(){
uni.navigateTo({
url:'./changeImg'
})
},
// //
getDefaultAddress(){ getDefaultAddress(){
let data={_action:'getdefaultconsignee'} let data={_action:'getdefaultconsignee'}
@ -99,7 +105,7 @@
}) })
} }
}, },
onLoad() { onShow() {
this.user_info=uni.getStorageSync('user_info') this.user_info=uni.getStorageSync('user_info')
this.getUserInfo() this.getUserInfo()
this.getDefaultAddress() this.getDefaultAddress()

43
pages/account/wishlist.vue

@ -1,13 +1,13 @@
<template> <template>
<view class="wishlist_body"> <view class="wishlist_body">
<view class="status_bar"></view> <view class="status_bar"></view>
<uni-nav-bar left-icon="left" :rightText="isDelete?'Done':'Delete'" title="Wishlist" color="#000000" @clickLeft="back" @clickRight="$refs.alertDialog.open()"/> <uni-nav-bar left-icon="left" :rightText="isDelete?'Done':'Delete'" title="Wishlist" color="#000000" @clickLeft="back" @clickRight="isDelete=true"/>
<view class="wishlist"> <view class="wishlist">
<view class="wishlist_item" v-for="(item,index) in goodsList" :key="index" @click="changeImage(item.id)"> <view class="wishlist_item" v-for="(item,index) in goodsList" :key="index" @click="isDelete?selectGoods(item.goods_id): goDetails(item.goods_id)">
<view class="wishlist_item_img"> <view class="wishlist_item_img">
<image :src="item.goods_img" mode="" class="wishlist_item_img_goods"></image> <image :src="item.goods_img" mode="" class="wishlist_item_img_goods"></image>
<image src="../../static/img/select.png" mode="" class="select" v-show="isDelete && item.is_select==0"></image> <image src="../../static/img/select1.png" mode="" class="select" v-if="isDelete && item.goods_id==goods_id || isAll"></image>
<image src="../../static/img/select.png" mode="" class="select" v-show="isDelete && item.is_select==1"></image> <image src="../../static/img/select.png" mode="" class="select" v-else-if="isDelete && item.goods_id!=goods_id"></image>
</view> </view>
<view class="wishlist_item_bottom"> <view class="wishlist_item_bottom">
<text>US${{item.promote_price?item.promote_price:item.shop_price}}</text> <text>US${{item.promote_price?item.promote_price:item.shop_price}}</text>
@ -16,17 +16,18 @@
</view> </view>
</view> </view>
<view class="wishlist_foot" v-show="isDelete"> <view class="wishlist_foot" v-show="isDelete">
<view class="wishlist_foot_left"> <view class="wishlist_foot_left" @click="isAll=true">
<image src="../../static/img/select2.png" mode=""></image> <image src="../../static/img/select2.png" mode="" v-if="!isAll"></image>
<image src="../../static/img/select1.png" mode="" v-else></image>
<text>All</text> <text>All</text>
</view> </view>
<view class="wishlist_foot_right"> <view class="wishlist_foot_right">
<button @click="removeLike">DELETE</button> <button :disabled="goods_id==''" @click="$refs.alertDialog.open()" :class="goods_id==''?'':'wishlist_foot_right_button'">DELETE</button>
</view> </view>
</view> </view>
<uni-popup ref="alertDialog" type="dialog"> <uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog type="error" cancelText="Close" confirmText="Delete" title="Tips" content="Whether to delete all favorites?" <uni-popup-dialog type="error" cancelText="Close" confirmText="Cancel" title="Tips" content="Cancel the collection of this product?"
@confirm="removeLike(0)" ></uni-popup-dialog> @confirm="removeLike()" ></uni-popup-dialog>
</uni-popup> </uni-popup>
</view> </view>
</template> </template>
@ -37,10 +38,26 @@
data() { data() {
return { return {
isDelete:false, isDelete:false,
goodsList:[] goodsList:[],
goods_id:'',
isAll:false
} }
}, },
methods:{ methods:{
selectGoods(id){
if(id==this.goods_id){
this.goods_id=''
}else{
this.goods_id=id
}
},
goDetails(id){
uni.navigateTo({
url:"../productDetails/index?goods_id="+id
})
},
getList(){ getList(){
let data={_action:'getfaviouritegoods',page_index:1,page_size:30} let data={_action:'getfaviouritegoods',page_index:1,page_size:30}
defaultRequest2(data).then(res=>{ defaultRequest2(data).then(res=>{
@ -60,13 +77,13 @@
title:res.message, title:res.message,
icon:'none' icon:'none'
}) })
this.changeImage(id,0)
} }
}) })
}, },
// //
removeLike(id){ removeLike(){
let data={_action:'unsetfaviouritegoods',goods_id:id} let data={_action:'unsetfaviouritegoods',goods_id:this.goods_id}
if(this.isAll)data.goods_id=0
defaultRequest2(data).then(res=>{ defaultRequest2(data).then(res=>{
console.info(res) console.info(res)
if(res.error==0){ if(res.error==0){

2
pages/index/index.vue

@ -266,7 +266,7 @@
}, },
onLoad() { onLoad() {
this.getIndex() this.getIndex()
console.info(this.curEndTime) // console.info(this.curEndTime)
}, },
computed:{ computed:{
// //

2
pages/index/search.vue

@ -33,7 +33,7 @@
</view> </view>
<view class="spike1_item_bottom"> <view class="spike1_item_bottom">
<text>US${{item.is_promote==0? item.shop_price :item.promote_price}}</text> <text>US${{item.is_promote==0? item.shop_price :item.promote_price}}</text>
<view class="spike1_item_text">US${{ item.shop_price }}</view> <view class="spike1_item_text" v-if="item.is_promote==1">US${{ item.shop_price }}</view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>

2
pages/order/details.vue

@ -123,7 +123,7 @@
</view> </view>
<view class="summary_item"> <view class="summary_item">
<view>Order total</view> <view>Order total</view>
<view>US${{goodsDate.order_amount}}</view> <view>US${{goodsDate.total_fee}}</view>
</view> </view>
<view class="summary_tips" v-if="details_index==0"> <view class="summary_tips" v-if="details_index==0">
<image src="../../static/img/gantan1.png" mode=""></image> <image src="../../static/img/gantan1.png" mode=""></image>

5
pages/shippingCart/index.vue

@ -10,7 +10,10 @@
<view class="empty" v-if="goods_list.length==0"> <view class="empty" v-if="goods_list.length==0">
<image src="/static/img/cart3.png" mode=""></image> <image src="/static/img/cart3.png" mode=""></image>
<text>Your cart is empty</text> <text>Your cart is empty</text>
<navigator url="/pages/category/index" open-type="switchTab">
<button>Shop Now</button> <button>Shop Now</button>
</navigator>
</view> </view>
<template v-else> <template v-else>
<view class="cart_info"> <view class="cart_info">
@ -24,7 +27,7 @@
<image src="../../static/img/select1.png" mode="" class="cart_select" v-show="item.is_check==1" @click="cartCheck(1,0,item.rec_id,index)"></image> <image src="../../static/img/select1.png" mode="" class="cart_select" v-show="item.is_check==1" @click="cartCheck(1,0,item.rec_id,index)"></image>
<image src="../../static/img/select2.png" mode="" class="cart_select" v-show="item.is_check==0" @click="cartCheck(1,1,item.rec_id,index)"></image> <image src="../../static/img/select2.png" mode="" class="cart_select" v-show="item.is_check==0" @click="cartCheck(1,1,item.rec_id,index)"></image>
<view class="good_info_left " > <view class="good_info_left " >
<view class="good_info_image"> <view class="good_info_image" @click="goDetails(item.goods_id)">
<image :src="item.goods_thumb" mode=""></image> <image :src="item.goods_thumb" mode=""></image>
</view> </view>
<view class="left_info"> <view class="left_info">

BIN
static/icon/left.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Loading…
Cancel
Save