Browse Source

优化完善

master
邓平艺 4 years ago
parent
commit
143735a5b0
  1. 1
      common/api.js
  2. 10
      common/styles/iconfont.css
  3. 4
      pages/center/index.vue
  4. 6
      pages/collect/index.vue
  5. 32
      pages/goodsDetail/index.vue
  6. 10
      pages/index/index.vue
  7. 12
      pages/login/index.vue
  8. 6
      pages/route/index.vue
  9. BIN
      static/center/shop-logo.png
  10. BIN
      static/tabbar/home-active.png
  11. BIN
      static/tabbar/home.png
  12. BIN
      static/tabbar/my-active.png
  13. BIN
      static/tabbar/my.png
  14. BIN
      static/tabbar/order-active.png
  15. BIN
      static/tabbar/order.png

1
common/api.js

@ -2,6 +2,7 @@
export const DEV = "dev"; // dev 测试 | prod 正式 export const DEV = "dev"; // dev 测试 | prod 正式
export const VERSION = '1.0.0'; // 版本号 export const VERSION = '1.0.0'; // 版本号
export const DEVURL = 'http://gxsky.lanzulive.com'; // 测试服请求地址 export const DEVURL = 'http://gxsky.lanzulive.com'; // 测试服请求地址
// export const DEVURL = 'http://192.168.3.8'; // 测试服请求地址, 韦港电脑
export const PRODURL = ''; // 正式服请求地址 export const PRODURL = ''; // 正式服请求地址
/* 首页相关接口 */ /* 首页相关接口 */

10
common/styles/iconfont.css

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "lf-iconfont"; /* Project id 2631569 */ font-family: "lf-iconfont"; /* Project id 2631569 */
src: url('//at.alicdn.com/t/font_2631569_rgieivs47oc.woff2?t=1624527625328') format('woff2'),
url('//at.alicdn.com/t/font_2631569_rgieivs47oc.woff?t=1624527625328') format('woff'),
url('//at.alicdn.com/t/font_2631569_rgieivs47oc.ttf?t=1624527625328') format('truetype');
src: url('//at.alicdn.com/t/font_2631569_oxrildtg1f.woff2?t=1624852913594') format('woff2'),
url('//at.alicdn.com/t/font_2631569_oxrildtg1f.woff?t=1624852913594') format('woff'),
url('//at.alicdn.com/t/font_2631569_oxrildtg1f.ttf?t=1624852913594') format('truetype');
} }
.lf-iconfont { .lf-iconfont {
@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.lf-icon-weixin:before {
content: "\f262";
}
.lf-icon-jia1:before { .lf-icon-jia1:before {
content: "\e6d4"; content: "\e6d4";
} }

4
pages/center/index.vue

@ -158,7 +158,7 @@
if(result.errMsg == 'scanCode:ok'){ if(result.errMsg == 'scanCode:ok'){
let content = result.result; // let content = result.result; //
this.$http(this.API.API_CONFIRM_CODE, {confirm_code: content}).then(res => { this.$http(this.API.API_CONFIRM_CODE, {confirm_code: content}).then(res => {
this.$msg(res.msg);
this.$msg(res.msg, {icon: 'success'});
}); });
} }
} }
@ -172,7 +172,7 @@
success: result => { success: result => {
console.log(result); console.log(result);
if(result.confirm){ if(result.confirm){
uni.setStorageSync('quit_login_state', true);
// uni.setStorageSync('quit_login_state', true);
uni.removeStorageSync('userinfo'); uni.removeStorageSync('userinfo');
this.$msg('退出成功', {icon: 'success'}); this.$msg('退出成功', {icon: 'success'});
} }

6
pages/collect/index.vue

@ -7,10 +7,11 @@
<view class="lf-font-32 lf-line-1" @click="enterDetail(index)">{{ item.goods.name }}</view> <view class="lf-font-32 lf-line-1" @click="enterDetail(index)">{{ item.goods.name }}</view>
<view class="lf-row-between lf-m-t-20"> <view class="lf-row-between lf-m-t-20">
<view class="lf-flex"> <view class="lf-flex">
<image class="shop-img" :src="item.goods.store.cover"></image>
<image class="shop-img" :src="item.goods.store.cover" v-if="item.goods.store.cover"></image>
<image class="shop-img" src="../../static/center/shop-logo.png" v-else></image>
<view class="lf-m-l-10 lf-font-28 lf-line-1 shop-name">{{ item.goods.store.name }}</view> <view class="lf-m-l-10 lf-font-28 lf-line-1 shop-name">{{ item.goods.store.name }}</view>
</view> </view>
<view @click="switchCollect(index)">
<view @click="switchCollect(index)" class="lf-font-40">
<u-icon name="heart-fill" color="#ff0f00" v-if="item.is_collect"></u-icon> <u-icon name="heart-fill" color="#ff0f00" v-if="item.is_collect"></u-icon>
<u-icon name="heart" v-else></u-icon> <u-icon name="heart" v-else></u-icon>
</view> </view>
@ -110,7 +111,6 @@
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;
border-radius: 10rpx; border-radius: 10rpx;
background-color: #EEEEEE;
} }
.shop-name{ .shop-name{
width: 340rpx; width: 340rpx;

32
pages/goodsDetail/index.vue

@ -13,7 +13,10 @@
<view class="lf-font-40">{{ goods_detail.name }}</view> <view class="lf-font-40">{{ goods_detail.name }}</view>
<view class="lf-row-between lf-font-24 lf-m-t-30 lf-p-b-20"> <view class="lf-row-between lf-font-24 lf-m-t-30 lf-p-b-20">
<view class="lf-flex price"> <view class="lf-flex price">
<view>¥{{ goods_detail.specs[0].selling_price }}</view>
<view class="lf-font-bold">
<text class="lf-font-24">¥</text>
<text class="lf-font-42">{{ goods_detail.specs[0].selling_price }}</text>
</view>
<view>¥{{ goods_detail.specs[0].original_price }}</view> <view>¥{{ goods_detail.specs[0].original_price }}</view>
<view v-if="goods_detail.specs[0].cost">{{ goods_detail.specs[0].cost }}</view> <view v-if="goods_detail.specs[0].cost">{{ goods_detail.specs[0].cost }}</view>
</view> </view>
@ -31,7 +34,8 @@
<view class="lf-font-32 lf-font-bold">适用门店</view> <view class="lf-font-32 lf-font-bold">适用门店</view>
<view class="lf-m-t-20 lf-row-between"> <view class="lf-m-t-20 lf-row-between">
<view class="lf-flex"> <view class="lf-flex">
<image class="lf-fle shop-img" :src="goods_detail.store.cover"></image>
<image class="lf-fle shop-img" :src="goods_detail.store.cover" v-if="goods_detail.store.cover"></image>
<image class="lf-fle shop-img" src="../../static/center/shop-logo.png" v-else></image>
<view class="lf-font-32 lf-m-l-20" style="max-width: 512rpx;">{{ goods_detail.store.name }}</view> <view class="lf-font-32 lf-m-l-20" style="max-width: 512rpx;">{{ goods_detail.store.name }}</view>
</view> </view>
<view @click="makePhoneCall(goods_detail.store.tel)"> <view @click="makePhoneCall(goods_detail.store.tel)">
@ -39,7 +43,6 @@
</view> </view>
</view> </view>
<view class="lf-flex lf-m-t-20" @click="openMap"> <view class="lf-flex lf-m-t-20" @click="openMap">
<!-- <u-icon name="map-fill" size="60"></u-icon> -->
<view style="width: 60rpx; height: 60rpx;" class="lf-row-center"> <view style="width: 60rpx; height: 60rpx;" class="lf-row-center">
<text class="lf-iconfont lf-icon-dizhi lf-font-40" style="color: #000000;"></text> <text class="lf-iconfont lf-icon-dizhi lf-font-40" style="color: #000000;"></text>
</view> </view>
@ -49,7 +52,8 @@
<!-- 商品详情 --> <!-- 商品详情 -->
<view class="goods-detail"> <view class="goods-detail">
<view class="lf-font-32 lf-font-bold lf-m-b-20">商品详情</view> <view class="lf-font-32 lf-font-bold lf-m-b-20">商品详情</view>
<image class="goods-img" :src="item" v-for="(item, index) in goods_detail.content" :key="index"></image>
<rich-text :nodes="goods_detail.content" v-if="goods_detail.content_type == 'rich_text'"></rich-text>
<image class="goods-img" :src="item" v-for="(item, index) in goods_detail.content" :key="index" v-if="goods_detail.content_type == 'img'"></image>
</view> </view>
<!-- 修饰专用 --> <!-- 修饰专用 -->
<view class="extra"></view> <view class="extra"></view>
@ -57,27 +61,19 @@
<view class="lf-row-between fixed-bottom"> <view class="lf-row-between fixed-bottom">
<view class="lf-flex lf-p-t-10 lf-p-b-10"> <view class="lf-flex lf-p-t-10 lf-p-b-10">
<view class="lf-flex-column lf-row-center icon-item" @click="$url('/pages/index/index', {type: 'switch'})"> <view class="lf-flex-column lf-row-center icon-item" @click="$url('/pages/index/index', {type: 'switch'})">
<!-- <u-icon name="home" size="50"></u-icon> -->
<image class="icon-img" src="../../static/center/home.png"></image> <image class="icon-img" src="../../static/center/home.png"></image>
<view class="lf-m-t-1">首页</view> <view class="lf-m-t-1">首页</view>
</view> </view>
<view class="lf-flex-column lf-row-center icon-item" @click="$url('/pages/contactService/index')"> <view class="lf-flex-column lf-row-center icon-item" @click="$url('/pages/contactService/index')">
<!-- <u-icon name="server-fill" size="50"></u-icon> -->
<image class="icon-img" src="../../static/center/service.png"></image> <image class="icon-img" src="../../static/center/service.png"></image>
<view class="lf-m-t-1">客服</view> <view class="lf-m-t-1">客服</view>
</view> </view>
<view class="lf-flex-column lf-row-center icon-item" @click="switchCollect"> <view class="lf-flex-column lf-row-center icon-item" @click="switchCollect">
<!-- <u-icon name="heart-fill" size="50" color="#FF0000" v-if="is_collect"></u-icon>
<u-icon name="heart" size="50" v-else></u-icon> -->
<image class="icon-img" src="../../static/center/collect-active.png" v-if="is_collect"></image> <image class="icon-img" src="../../static/center/collect-active.png" v-if="is_collect"></image>
<image class="icon-img" src="../../static/center/collect.png" v-else></image> <image class="icon-img" src="../../static/center/collect.png" v-else></image>
<view class="lf-m-t-1">{{ is_collect ? '已收藏' : '收藏' }}</view> <view class="lf-m-t-1">{{ is_collect ? '已收藏' : '收藏' }}</view>
</view> </view>
<button class="lf-flex-column lf-row-center icon-item" open-type="share"> <button class="lf-flex-column lf-row-center icon-item" open-type="share">
<!-- <u-icon name="share" size="50"></u-icon> -->
<!-- <view class="icon-img lf-row-center">
<text class="lf-iconfont lf-icon-fenxiangzhuanfa lf-font-32"></text>
</view> -->
<image class="icon-img" src="../../static/center/share.png"></image> <image class="icon-img" src="../../static/center/share.png"></image>
<view class="lf-m-t-1">分享</view> <view class="lf-m-t-1">分享</view>
</button> </button>
@ -89,6 +85,8 @@
</template> </template>
<script> <script>
let time = null;
export default { export default {
data(){ data(){
return { return {
@ -111,10 +109,16 @@
}, },
methods: { methods: {
getGoodsDetail(){ getGoodsDetail(){
let that = this;
this.$http(this.API.API_GOODS_DETAIL, {goods_id: this.goods_id}).then(res => { this.$http(this.API.API_GOODS_DETAIL, {goods_id: this.goods_id}).then(res => {
console.log("res", res); console.log("res", res);
this.goods_detail = res.data; this.goods_detail = res.data;
this.is_collect = Boolean(res.data.user.is_collect); this.is_collect = Boolean(res.data.user.is_collect);
}).catch(err => {
that.$msg(err.msg);
time = setTimeout(() => {
that.$toBack();
}, 1000);
}) })
}, },
// //
@ -125,7 +129,7 @@
return; return;
} }
this.$http(this.API.API_COLLECT_DEAL, {goods_id: this.goods_id}).then(res => { this.$http(this.API.API_COLLECT_DEAL, {goods_id: this.goods_id}).then(res => {
console.log("res", res);
this.$msg(res.msg);
this.is_collect = Boolean(res.data.user.is_collect); this.is_collect = Boolean(res.data.user.is_collect);
}) })
}, },
@ -188,7 +192,6 @@
background-color: #FFFFFF; background-color: #FFFFFF;
.price>view:nth-of-type(1){ .price>view:nth-of-type(1){
color: #FF0000; color: #FF0000;
font-size: 40rpx;
margin-right: 22rpx; margin-right: 22rpx;
font-weight: bold; font-weight: bold;
} }
@ -242,7 +245,6 @@
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;
border-radius: 10rpx; border-radius: 10rpx;
background-color: #EEEEEE;
} }
} }

10
pages/index/index.vue

@ -10,7 +10,7 @@
</view> </view>
<view class="right"> <view class="right">
<view class="lf-line-2 title">{{ item.name }}</view> <view class="lf-line-2 title">{{ item.name }}</view>
<view class="lf-flex tips">
<view class="lf-flex tips" v-if="item.specs[0]">
<view class="u-line-progress"> <view class="u-line-progress">
<u-line-progress :percent="item.specs[0].sold_percent" height="20" :striped="true" active-color="#FE9903" :show-percent="false" inactive-color="#F5F5F5"></u-line-progress> <u-line-progress :percent="item.specs[0].sold_percent" height="20" :striped="true" active-color="#FE9903" :show-percent="false" inactive-color="#F5F5F5"></u-line-progress>
</view> </view>
@ -18,11 +18,12 @@
<text class="bought">{{ item.specs[0].sold_stock_text }}</text> <text class="bought">{{ item.specs[0].sold_stock_text }}</text>
</view> </view>
<view class="lf-row-between price"> <view class="lf-row-between price">
<text class="lf-font-bold">
<text class="lf-font-bold" v-if="item.specs[0]">
<text class="lf-font-24"></text> <text class="lf-font-24"></text>
<text class="lf-font-42">{{ item.specs[0].selling_price }}</text> <text class="lf-font-42">{{ item.specs[0].selling_price }}</text>
</text> </text>
<text class="lf-font-24 original-price">{{ item.specs[0].original_price }}</text>
<text class="lf-font-24 original-price" v-if="item.specs[0]">{{ item.specs[0].original_price }}</text>
<text v-else></text>
<button>立即抢购</button> <button>立即抢购</button>
</view> </view>
</view> </view>
@ -88,6 +89,9 @@
// tab // tab
change(index) { change(index) {
this.current = index; this.current = index;
if(this.tab_list[index].list.length <= 0){
this.getGoodsList(); // tab
}
}, },
// tab // tab
getCategoryList(){ getCategoryList(){

12
pages/login/index.vue

@ -7,7 +7,7 @@
<view class="lf-m-t-30 lf-font-32" v-if="type == 'phone'">{{ userInfo.nickname || '游客用户' }}</view> <view class="lf-m-t-30 lf-font-32" v-if="type == 'phone'">{{ userInfo.nickname || '游客用户' }}</view>
<block v-if="type == 'userinfo'"> <block v-if="type == 'userinfo'">
<button class="btn" @click="getUserProfile"> <button class="btn" @click="getUserProfile">
<u-icon name="weixin-fill" color="#ffffff" size="60" class="lf-text-vertical"></u-icon>
<text class="lf-iconfont lf-icon-weixin lf-font-60 lf-text-vertical"></text>
<text class="lf-m-l-20">微信快捷登录</text> <text class="lf-m-l-20">微信快捷登录</text>
</button> </button>
<!-- <view class="lf-m-t-40 lf-font-28" @click="$toBack()">暂不绑定继续操作</view> --> <!-- <view class="lf-m-t-40 lf-font-28" @click="$toBack()">暂不绑定继续操作</view> -->
@ -15,7 +15,7 @@
</block> </block>
<block v-else-if="type == 'phone'"> <block v-else-if="type == 'phone'">
<button class="btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"> <button class="btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
<u-icon name="weixin-fill" color="#ffffff" size="60" class="lf-text-vertical"></u-icon>
<text class="lf-iconfont lf-icon-weixin lf-font-60 lf-text-vertical"></text>
<text class="lf-m-l-20">绑定手机号</text> <text class="lf-m-l-20">绑定手机号</text>
</button> </button>
<!-- <view class="lf-m-t-40 lf-font-28" @click="$url('/pages/login/accountLogin')">使用手机号登录</view> --> <!-- <view class="lf-m-t-40 lf-font-28" @click="$url('/pages/login/accountLogin')">使用手机号登录</view> -->
@ -77,11 +77,11 @@
if(event.detail.errMsg == 'getPhoneNumber:ok'){ if(event.detail.errMsg == 'getPhoneNumber:ok'){
let encryptedData = event.detail.encryptedData; let encryptedData = event.detail.encryptedData;
let iv = event.detail.iv; let iv = event.detail.iv;
let userInfo = uni.getStorageSync('userinfo') || {};
// let userInfo = uni.getStorageSync('userinfo') || {};
this.$http(this.API.API_WECHAT_SETPHONE, { this.$http(this.API.API_WECHAT_SETPHONE, {
encryptedData, encryptedData,
iv, iv,
token: userInfo.token
// token: userInfo.token //
}).then(res => { }).then(res => {
console.log("更新手机号", res); console.log("更新手机号", res);
this.$msg('更新成功', {icon: 'success'}); this.$msg('更新成功', {icon: 'success'});
@ -101,12 +101,12 @@
let encryptedData = result.encryptedData; let encryptedData = result.encryptedData;
let iv = result.iv; let iv = result.iv;
let signature = result.signature; let signature = result.signature;
let userInfo = uni.getStorageSync('userinfo') || {};
// let userInfo = uni.getStorageSync('userinfo') || {};
this.$http(this.API.API_WECHAT_SETPROFILE, { this.$http(this.API.API_WECHAT_SETPROFILE, {
encryptedData, encryptedData,
iv, iv,
token: userInfo.token
// token: userInfo.token //
}).then(res => { }).then(res => {
console.log("更新用户信息", res); console.log("更新用户信息", res);
this.$msg('更新成功', {icon: 'success'}); this.$msg('更新成功', {icon: 'success'});

6
pages/route/index.vue

@ -18,6 +18,12 @@
options.page_url = '/pages/index/index'; options.page_url = '/pages/index/index';
options.is_tabbar = true; // tabbar options.is_tabbar = true; // tabbar
this.joinPagePath(options); this.joinPagePath(options);
}else{
let obj = {
page_url: '/pages/index/index', //
is_tabbar: true
};
this.joinPagePath(obj);
} }
}, },
// //

BIN
static/center/shop-logo.png

After

Width: 90  |  Height: 90  |  Size: 2.9 KiB

BIN
static/tabbar/home-active.png

Before

Width: 63  |  Height: 63  |  Size: 2.3 KiB

After

Width: 63  |  Height: 63  |  Size: 1.9 KiB

BIN
static/tabbar/home.png

Before

Width: 63  |  Height: 63  |  Size: 2.3 KiB

After

Width: 63  |  Height: 63  |  Size: 1.8 KiB

BIN
static/tabbar/my-active.png

Before

Width: 63  |  Height: 63  |  Size: 2.8 KiB

After

Width: 63  |  Height: 63  |  Size: 2.3 KiB

BIN
static/tabbar/my.png

Before

Width: 63  |  Height: 63  |  Size: 2.6 KiB

After

Width: 63  |  Height: 63  |  Size: 2.3 KiB

BIN
static/tabbar/order-active.png

Before

Width: 63  |  Height: 63  |  Size: 1.8 KiB

After

Width: 63  |  Height: 63  |  Size: 1.6 KiB

BIN
static/tabbar/order.png

Before

Width: 63  |  Height: 63  |  Size: 1.7 KiB

After

Width: 63  |  Height: 63  |  Size: 1.5 KiB

Loading…
Cancel
Save