Browse Source

添加人气爆款列表/优化时间日期显示/添加频道商品列表页面跳转

test
Enzo 4 years ago
parent
commit
73a9dfeae7
  1. 5
      common/api.js
  2. 2
      common/uploadFile.js
  3. 6
      pages.json
  4. 2
      pages/collect/index.vue
  5. 2
      pages/goodsList/index.vue
  6. 110
      pages/hot/index.vue
  7. 6
      pages/index/index.vue
  8. 2
      pages/message/index.vue
  9. 2
      pages/order/order.vue
  10. 4
      pages/order/order_details.vue
  11. 2
      pages/order/unpay_details.vue

5
common/api.js

@ -1,7 +1,8 @@
// appId: 正式 null | 测试 wxb35ef055a4dd8ad4 // appId: 正式 null | 测试 wxb35ef055a4dd8ad4
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://hainan.lanzulive.com'; // 测试服请求地址
// export const DEVURL = 'http://hainan.lanzulive.com'; // 测试服请求地址
export const DEVURL = 'http://hainan.com'; // 测试服请求地址
export const PRODURL = ''; // 正式服请求地址 export const PRODURL = ''; // 正式服请求地址
@ -26,6 +27,8 @@ export const API_ADVICEDETAILS = '/api/agent_product/show'; //推荐列表详情
export const API_PRODUCTLIST = '/api/channel/product'; //频道产品列表 export const API_PRODUCTLIST = '/api/channel/product'; //频道产品列表
export const API_SPECIALLIST = '/api/special/show'; //专题列表 export const API_SPECIALLIST = '/api/special/show'; //专题列表
export const API_HOTLIST = '/api/agent_product/hot'; //热门爆款推荐
export const API_NOTICEDETAILS = '/api/notice/show'; //公告详情 export const API_NOTICEDETAILS = '/api/notice/show'; //公告详情
export const API_REGISTERAGREE = '/api/agent_info/reg_protocol'; //注册协议 export const API_REGISTERAGREE = '/api/agent_info/reg_protocol'; //注册协议

2
common/uploadFile.js

@ -35,7 +35,7 @@ const uploadFile = function (filePath, successc, failc) {
filePath: filePath,//要上传文件资源的路径 filePath: filePath,//要上传文件资源的路径
name: 'image', name: 'image',
header: { header: {
appid: 'wx0e8ebcd9ca9e4b97',
appid: 'wxb35ef055a4dd8ad4',
Authentication: uni.getStorageSync('userinfo').token Authentication: uni.getStorageSync('userinfo').token
}, },

6
pages.json

@ -17,6 +17,12 @@
"navigationBarTitleText": "我的" "navigationBarTitleText": "我的"
} }
}, },
{
"path": "pages/hot/index",
"style": {
"navigationBarTitleText": "人气爆款"
}
},
{ {
"path": "pages/notice/notice", "path": "pages/notice/notice",
"style": { "style": {

2
pages/collect/index.vue

@ -5,7 +5,7 @@
<image class="goods-img" mode="aspectFill" :src="item.product.picture" @click="enterDetail(item.id)"></image> <image class="goods-img" mode="aspectFill" :src="item.product.picture" @click="enterDetail(item.id)"></image>
<view style="width: 458rpx;"> <view style="width: 458rpx;">
<view class="lf-font-28 lf-line-2" style="height: 80rpx;" @click="enterDetail(item.id)">{{ item.product.title }}</view> <view class="lf-font-28 lf-line-2" style="height: 80rpx;" @click="enterDetail(item.id)">{{ item.product.title }}</view>
<view class="lf-m-t-15 lf-font-24 lf-color-gray">{{ $timer(item.created_at*1000) || '' }}</view>
<view class="lf-m-t-15 lf-font-24 lf-color-gray">{{ item.created_at || '' }}</view>
<view class="lf-row-between lf-m-t-20"> <view class="lf-row-between lf-m-t-20">
<lf-price price="3599.00"></lf-price> <lf-price price="3599.00"></lf-price>

2
pages/goodsList/index.vue

@ -2,7 +2,7 @@
<view> <view>
<!-- 活动列表 --> <!-- 活动列表 -->
<view class="content"> <view class="content">
<view class="item" v-for="(item,index) in list" :key="index">
<view class="item" v-for="(item,index) in list" :key="index" @click="$url('/pages/goodsDetail/index?goods_id='+item.id)">
<view class="cover"> <view class="cover">
<image :src="item.product.picture" class="lf-w-100 lf-h-100" mode="aspectFill"></image> <image :src="item.product.picture" class="lf-w-100 lf-h-100" mode="aspectFill"></image>
</view> </view>

110
pages/hot/index.vue

@ -0,0 +1,110 @@
<template>
<view>
<!-- 活动列表 -->
<view class="content">
<view class="item" v-for="(item,index) in list" :key="index" @click="$url('/pages/goodsDetail/index?goods_id='+item.id)">
<view class="cover">
<image :src="item.product.picture" class="lf-w-100 lf-h-100" mode="aspectFill"></image>
</view>
<view style="width: 420rpx;">
<view class="lf-font-28 lf-color-333 lf-m-b-20 lf-line-2" style="height: 78rpx;">{{item.product.title}}</view>
<view class="lf-font-24 lf-color-gray">本套票只包含两个成人不可带小孩</view>
<view class="lf-flex lf-m-t-25">
<lf-price :price="item.price"></lf-price>
<text class="lf-font-24 lf-color-gray lf-line-through lf-m-l-15">¥{{item.original_price}}</text>
</view>
</view>
</view>
</view>
<!-- 加载 -->
<view class="loading-more">
<text v-if="list.length" :class="{'loading-more-text': loadingClass}">{{ loadingText }}</text>
<lf-nocontent v-else></lf-nocontent>
</view>
<!-- 回到顶部 -->
<u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}"></u-back-top>
</view>
</template>
<script>
export default {
data(){
return {
list: [],
loadingClass: false,
loadingText: '已加载全部数据~',
page: 1,
isPage: true,
pageSize: 20,
}
},
onLoad(e){
this.getActivityList();
},
methods: {
getActivityList(){
this.$http(this.API.API_HOTLIST,{page:this.page}).then(res => {
let isPage = res.data.next_page_url == null?false:true;
this.isPage = isPage;
let list = res.data.data;
if(!isPage){
this.loadingClass = false;
this.loadingText = '已加载全部数据~';
}
if(this.page == 1){
this.list = list;
}else{
this.list.push(...list);
}
console.log(list)
})
},
//
enterDetail(index){
let goods_id = this.list[index].goods_id;
this.$url('/pages/goodsDetail/index?goods_id='+ goods_id);
}
},
onReachBottom(){
if(this.isPage){
this.page = this.page + 1;
this.getActivityList();
}
},
onPullDownRefresh(){
this.page = 1;
this.isPage = true;
this.loadingClass = true;
this.loadingText = '正在加载中';
this.getActivityList();
uni.stopPullDownRefresh();
}
}
</script>
<style lang="scss" scoped="scoped">
.content{
padding: 0 32rpx;
box-sizing: border-box;
width: 750rpx;
height: max-content;
.item{
width: 100%;
height: auto;
border-bottom: 1rpx solid #E5E5E5;
padding: 30rpx 0;
display: flex;
&:last-child{
border-bottom: none;
}
.cover{
width: 250rpx;
height: 210rpx;
border-radius: 20rpx;
overflow: hidden;
margin-right: 15rpx;
}
}
}
</style>

6
pages/index/index.vue

@ -43,7 +43,7 @@
<!-- 人气爆款 --> <!-- 人气爆款 -->
<view class="lf-row-between lf-m-t-40"> <view class="lf-row-between lf-m-t-40">
<view class="lf-font-36 lf-font-bold lf-color-333">人气爆款</view> <view class="lf-font-36 lf-font-bold lf-color-333">人气爆款</view>
<view class="lf-flex lf-color-555" @click="$url('/pages/goodsDetail/index')">
<view class="lf-flex lf-color-555" @click="$url('/pages/hot/index')">
<view class="lf-m-r-10">更多</view> <view class="lf-m-r-10">更多</view>
<view class="lf-iconfont lf-icon-xiangyou lf-text-vertical"></view> <view class="lf-iconfont lf-icon-xiangyou lf-text-vertical"></view>
</view> </view>
@ -162,9 +162,9 @@
this.home_ad1 = res.data?.special this.home_ad1 = res.data?.special
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
console.log(this.home_ad1) console.log(this.home_ad1)
}).catch(err => {
}).catch(err => {})
})
}, },
// tabs // tabs
tabChange(current){ tabChange(current){

2
pages/message/index.vue

@ -7,7 +7,7 @@
<text class="gray" v-else></text> <text class="gray" v-else></text>
<text class="lf-font-28 lf-m-l-10">收到一条新消息</text> <text class="lf-font-28 lf-m-l-10">收到一条新消息</text>
</view> </view>
<view class="lf-color-gray lf-font-22">{{$timer(item.created_at*1000) || ''}} </view>
<view class="lf-color-gray lf-font-22">{{item.created_at}} </view>
</view> </view>
<view class="lf-font-24 lf-color-555">{{item.title}}</view> <view class="lf-font-24 lf-color-555">{{item.title}}</view>
</view> </view>

2
pages/order/order.vue

@ -34,7 +34,7 @@
<view> <view>
<view class="solid-top flex justify-between align-center text-center"> <view class="solid-top flex justify-between align-center text-center">
<view class="text-gray lf-font-28" style="padding: 20rpx;"> <view class="text-gray lf-font-28" style="padding: 20rpx;">
{{$timer(item.created_at*1000)}}
{{item.created_at}}
</view> </view>
<view :class="'col-status'+item.status" style="padding: 20rpx 24rpx 20rpx 20rpx;"> <view :class="'col-status'+item.status" style="padding: 20rpx 24rpx 20rpx 20rpx;">
{{item.status_text}} {{item.status_text}}

4
pages/order/order_details.vue

@ -36,12 +36,12 @@
</view> </view>
<view class="cu-bar padding-lr solid-bottom"> <view class="cu-bar padding-lr solid-bottom">
<text class="lf-color-555 lf-font-28">下单时间</text> <text class="lf-color-555 lf-font-28">下单时间</text>
<text class="lf-font-28 text-black1">{{ $timer(orderDetails.created_at*1000)}}</text>
<text class="lf-font-28 text-black1">{{ orderDetails.created_at }}</text>
</view> </view>
<view class="cu-bar padding-lr solid-bottom"> <view class="cu-bar padding-lr solid-bottom">
<text class="lf-color-555 lf-font-28">付款时间</text> <text class="lf-color-555 lf-font-28">付款时间</text>
<text class="lf-font-28 text-black1" v-if="orderDetails.paid_at == 0">暂未付款</text> <text class="lf-font-28 text-black1" v-if="orderDetails.paid_at == 0">暂未付款</text>
<text class="lf-font-28 text-black1" v-else>{{ $timer(orderDetails.paid_at*1000)}}</text>
<text class="lf-font-28 text-black1" v-else>{{ orderDetails.paid_at }}</text>
</view> </view>
<view class="cu-bar padding-lr"> <view class="cu-bar padding-lr">
<text class="lf-color-555 lf-font-28">支付方式</text> <text class="lf-color-555 lf-font-28">支付方式</text>

2
pages/order/unpay_details.vue

@ -36,7 +36,7 @@
</view> </view>
<view class="cu-bar padding-lr solid-bottom"> <view class="cu-bar padding-lr solid-bottom">
<text class="lf-color-555 lf-font-28">下单时间</text> <text class="lf-color-555 lf-font-28">下单时间</text>
<text class="lf-font-28 text-black1">{{$timer(orderDetails.created_at*1000)}}</text>
<text class="lf-font-28 text-black1">{{orderDetails.created_at}}</text>
</view> </view>
<view class="cu-bar padding-lr"> <view class="cu-bar padding-lr">
<text class="lf-color-555 lf-font-28">支付方式</text> <text class="lf-color-555 lf-font-28">支付方式</text>

Loading…
Cancel
Save