liupopo 2 years ago
parent
commit
f59a2442b4
  1. 48
      mallplusui-uniapp-app/pages/index/index.vue
  2. 6
      mallplusui-uniapp-app/pagesA/product/groupList.vue
  3. 14
      mallplusui-uniapp-app/pagesA/product/list.vue
  4. 6
      mallplusui-uniapp-app/pagesA/product/product.vue
  5. 11
      mallplusui-uniapp-app/pagesU/notice/subjectDetail.vue
  6. BIN
      mallplusui-uniapp-app/static/njfw_icon.png
  7. BIN
      mallplusui-uniapp-app/static/nywz_icon.png
  8. BIN
      mallplusui-uniapp-app/static/shwz_icon.png

48
mallplusui-uniapp-app/pages/index/index.vue

@ -1,19 +1,6 @@
<template> <template>
<view class="container"> <view class="container">
<!-- 小程序头部兼容 -->
<!-- #ifdef MP -->
<nav-bar>汇融云链</nav-bar>
<view class="MP-search" @click="search()" style=""><input class="MP-search-input" type="text" disabled="true"
placeholder="输入关键字搜索" /></view>
<!-- #endif -->
<!-- 头部轮播 -->
<!-- #ifdef MP -->
<view class="carousel-section" style="margin-top: 80upx;">
<!-- #endif -->
<!-- #ifndef MP -->
<view class="carousel-section"> <view class="carousel-section">
<!-- #endif -->
<!-- 标题栏和状态栏占位符 --> <!-- 标题栏和状态栏占位符 -->
<view class="titleNview-placing"></view> <view class="titleNview-placing"></view>
<!-- 背景色区域 --> <!-- 背景色区域 -->
@ -34,11 +21,11 @@
<!-- 分类 --> <!-- 分类 -->
<view class="cate-section"> <view class="cate-section">
<view class="cate-item" @click="navToTabPage('../../pagesA/product/list?isFenxiao=1')"> <view class="cate-item" @click="navToTabPage('../../pagesA/product/list?isFenxiao=1')">
<image src="/static/temp//antFill-gift.png"></image> <image src="/static/nywz_icon.png"></image>
<text>农业物资</text> <text>农业物资</text>
</view> </view>
<view class="cate-item" @click="navToTabPage('../../pagesA/product/list?isVip=1')"> <view class="cate-item" @click="navToTabPage('../../pagesA/product/list?isVip=1')">
<image src="/static/temp/fasfausers.png"></image> <image src="/static/shwz_icon.png"></image>
<text>生活物资</text> <text>生活物资</text>
</view> </view>
<view class="cate-item" @click="navToTabPage('../../pagesA/product/groupList')"> <view class="cate-item" @click="navToTabPage('../../pagesA/product/groupList')">
@ -46,7 +33,7 @@
<text>拼团特价</text> <text>拼团特价</text>
</view> </view>
<view class="cate-item" @click="navToTabPage('/pagesU/notice/subjectList')"> <view class="cate-item" @click="navToTabPage('/pagesU/notice/subjectList')">
<image src="/static/temp/antFill-home.png"></image> <image src="/static/njfw_icon.png"></image>
<text>农机服务</text> <text>农机服务</text>
</view> </view>
<!-- <view class="cate-item" @click="navToTabPage('../../pagesA/build/communityList')"> <!-- <view class="cate-item" @click="navToTabPage('../../pagesA/build/communityList')">
@ -206,7 +193,7 @@
<text class="title clamp">{{ item.productName }}</text> <text class="title clamp">{{ item.productName }}</text>
<view> <view>
<text class="price">惠农价{{ item.price }}</text> <text class="price">惠农价{{ item.price }}</text>
<text class="m-price"> 县区商超价{{ item.price }}</text> <!-- <text class="m-price"> 县区商超价{{ item.price }}</text> -->
</view> </view>
@ -229,10 +216,10 @@
<view class="image-wrapper"> <view class="image-wrapper">
<image :src="item.pic" mode="aspectFill"></image> <image :src="item.pic" mode="aspectFill"></image>
</view> </view>
<text class="title clamp">{{ item.name }}</text> <text class="title clamp">{{ item.productName }}</text>
<view> <view>
<text class="price">惠农价{{ item.price }}</text> <text class="price">惠农价{{ item.price }}</text>
<text class="m-price">县区商超价{{ item.price }}</text> <!-- <text class="m-price">县区商超价{{ item.price }}</text> -->
</view> </view>
</view> </view>
@ -254,14 +241,13 @@
<image :src="item.pic" mode="aspectFill"></image> <image :src="item.pic" mode="aspectFill"></image>
</view> </view>
<text class="title clamp">{{ item.name }}</text> <text class="title clamp">{{ item.name }}</text>
<text class="label">{{ item.storeName }}</text> <!-- <text class="label">{{ item.storeName }}</text> -->
<text class="price">惠农价{{ item.price }}</text> <text class="price">惠农价{{ item.price }}</text>
</view> </view>
<uni-load-more :status="loadingType"></uni-load-more> <uni-load-more :status="loadingType"></uni-load-more>
</view> </view>
<!-- <mallplusCopyright></mallplusCopyright> --> <!-- <mallplusCopyright></mallplusCopyright> -->
</view> </view>
</view>
</template> </template>
<script> <script>
@ -314,6 +300,7 @@
this.getNewProductList(); this.getNewProductList();
}, },
onPullDownRefresh() { onPullDownRefresh() {
console.log("onPullDownRefresh") console.log("onPullDownRefresh")
this.pageNum = this.pageNum + 1; this.pageNum = this.pageNum + 1;
this.getNewProductList('refresh'); this.getNewProductList('refresh');
@ -446,6 +433,7 @@
* 加载首页数据 * 加载首页数据
*/ */
async loadData() { async loadData() {
this.getBanner(); this.getBanner();
this.getHotGoodsList(); this.getHotGoodsList();
//this.getFlashPromotion(); //this.getFlashPromotion();
@ -453,6 +441,18 @@
this.getStoreList(); this.getStoreList();
this.homeNewProduct(); this.homeNewProduct();
this.homeRecommendProduct(); this.homeRecommendProduct();
uni.getSystemInfo({
success: res => {
console.log("屏幕宽度", res.windowWidth)
}
})
uni.createSelectorQuery().in(this).select(".carousel-section").boundingClientRect(data => {
console.log("屏幕宽度", data.height)
// {"id":"","dataset":{},"left":12,"right":308,"top":12,"bottom":315,"width":296,"height":303}
}).exec(function(res) {
// exec便
})
}, },
/** /**
@ -462,7 +462,7 @@
let params = {}; let params = {};
let groupHotGoodsList = await Api.apiCall('get', Api.index.homeNewProduct, params); let groupHotGoodsList = await Api.apiCall('get', Api.index.homeNewProduct, params);
if (groupHotGoodsList) { if (groupHotGoodsList) {
console.log("新品推荐》》》》》",groupHotGoodsList.records) console.log("新品推荐》》》》》", groupHotGoodsList.records)
this.homeNewProductList = groupHotGoodsList.records; this.homeNewProductList = groupHotGoodsList.records;
} }
@ -474,7 +474,7 @@
async homeRecommendProduct() { async homeRecommendProduct() {
let params = {}; let params = {};
let groupHotGoodsList = await Api.apiCall('get', Api.index.homeRecommendProduct, params); let groupHotGoodsList = await Api.apiCall('get', Api.index.homeRecommendProduct, params);
console.log("人气推荐》》》》》",groupHotGoodsList.records) console.log("人气推荐》》》》》", groupHotGoodsList.records)
this.homeRecommendProductList = groupHotGoodsList.records; this.homeRecommendProductList = groupHotGoodsList.records;
}, },
/** /**
@ -573,7 +573,7 @@
async getHotGoodsList() { async getHotGoodsList() {
let params = {}; let params = {};
let groupHotGoodsList = await Api.apiCall('get', Api.goods.groupHotGoodsList, params); let groupHotGoodsList = await Api.apiCall('get', Api.goods.groupHotGoodsList, params);
console.log("团购信息》》》》》",groupHotGoodsList) console.log("团购信息》》》》》", groupHotGoodsList)
this.groupHotGoodsList = groupHotGoodsList; this.groupHotGoodsList = groupHotGoodsList;
}, },

6
mallplusui-uniapp-app/pagesA/product/groupList.vue

@ -18,7 +18,7 @@
<text class="title clamp">{{ item.goods.name }}</text> <text class="title clamp">{{ item.goods.name }}</text>
<view class="price-box"> <view class="price-box">
<text class="price">{{ item.groupPrice }}</text> <text class="price">{{ item.groupPrice }}</text>
<text>原价 {{ item.goods.price }}</text> <!-- <text>原价 {{ item.goods.price }}</text> -->
</view> </view>
</view> </view>
</view> </view>
@ -395,11 +395,11 @@ page,
color: $font-color-light; color: $font-color-light;
} }
.price { .price {
font-size: $font-lg; font-size: 26upx;
color: $uni-color-primary; color: $uni-color-primary;
line-height: 1; line-height: 1;
&:before { &:before {
content: '¥'; content: '惠农团购价¥';
font-size: 26upx; font-size: 26upx;
} }
} }

14
mallplusui-uniapp-app/pagesA/product/list.vue

@ -19,18 +19,18 @@
<view v-for="(item, index) in goodsList" :key="index" class="goods-item" @click="navToDetailPage(item)"> <view v-for="(item, index) in goodsList" :key="index" class="goods-item" @click="navToDetailPage(item)">
<view class="image-wrapper"><image :src="item.pic" mode="aspectFill"></image></view> <view class="image-wrapper"><image :src="item.pic" mode="aspectFill"></image></view>
<text class="title clamp">{{ item.name }}</text> <text class="title clamp">{{ item.name }}</text>
<view class="price-box" v-if="item.isFenxiao == 1"> <view class="price-box" >
<text class="price">{{ item.price }}</text> <text class="price">{{ item.price }}</text>
<!-- <text>佣金 ¥{{ item.fenxiaoPrice }}</text> --> <!-- <text>佣金 ¥{{ item.fenxiaoPrice }}</text> -->
</view> </view>
<view class="price-box" v-if="item.isVip == 1"> <!-- <view class="price-box" v-if="item.isVip == 1">
<text class="price">会员价{{ item.vipPrice }}</text> <text class="price">会员价{{ item.vipPrice }}</text>
<text>商品价 ¥{{ item.price }}</text> <text>商品价 ¥{{ item.price }}</text>
</view> </view> -->
<view class="price-box" v-else-if="item.isFenxiao == 0 && item.isVip == 0"> <!-- <view class="price-box" v-else-if="item.isFenxiao == 0 && item.isVip == 0">
<text class="price">{{ item.price }}</text> <text class="price">{{ item.price }}</text>
<text>已售 {{ item.sale }}</text> <text>已售 {{ item.sale }}</text>
</view> </view> -->
</view> </view>
</view> </view>
<!-- 列表显示 --> <!-- 列表显示 -->
@ -457,12 +457,12 @@ page,
color: $font-color-light; color: $font-color-light;
} }
.price { .price {
font-size: $font-lg; font-size: 26upx;
color: $uni-color-primary; color: $uni-color-primary;
line-height: 1; line-height: 1;
&:before { &:before {
content: '惠农价¥'; content: '惠农价¥';
font-size: $font-lg; font-size: 26upx;
} }
} }
} }

6
mallplusui-uniapp-app/pagesA/product/product.vue

@ -16,7 +16,7 @@
<text class="price" v-else-if="!goods.vipPrice">惠农价¥{{ goods.price }}</text> <text class="price" v-else-if="!goods.vipPrice">惠农价¥{{ goods.price }}</text>
<text class="m-price" v-if="!goods.vipPrice">县区商超价{{ goods.originalPrice }}</text> <text class="m-price" v-if="!goods.vipPrice">县区商超价{{ goods.originalPrice }}</text>
<text class="m-price" v-else-if="goods.vipPrice && goods.vipPrice > 0">¥{{ goods.price }}</text> <text class="m-price" v-else-if="goods.vipPrice && goods.vipPrice > 0">¥{{ goods.price }}</text>
<text class="price">优惠¥{{ goods.originalPrice- goods.price }}</text> <text class="price">优惠¥{{ (goods.originalPrice- goods.price) | formatNumber}}</text>
<text class="coupon-tip" v-if="goods.memberRate && goods.memberRate != 10">会员折扣{{ goods.memberRate }}</text> <text class="coupon-tip" v-if="goods.memberRate && goods.memberRate != 10">会员折扣{{ goods.memberRate }}</text>
</view> </view>
<view class="bot-row"> <view class="bot-row">
@ -376,6 +376,10 @@ export default {
formatCreateTime(time) { formatCreateTime(time) {
let date = new Date(time); let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss'); return formatDate(date, 'yyyy-MM-dd hh:mm:ss');
},
formatNumber(number) {
return new Number(number).toFixed(2);
} }
}, },
methods: { methods: {

11
mallplusui-uniapp-app/pagesU/notice/subjectDetail.vue

@ -70,9 +70,7 @@ export default {
favorite: true, favorite: true,
shareList: [], shareList: [],
desc: ` desc: "",
`,
skuList: [] skuList: []
}; };
}, },
@ -89,7 +87,12 @@ export default {
if (data) { if (data) {
let detailData = data; let detailData = data;
this.detailData = detailData; this.detailData = detailData;
this.desc = data.content;
var richtext= data.content;
const regex = new RegExp('<img', 'gi');
richtext = richtext.replace(regex, `<img style="max-width:100%;height:auto;display:block;"`);
this.desc = richtext;
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: detailData.name title: detailData.name
}); });

BIN
mallplusui-uniapp-app/static/njfw_icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

BIN
mallplusui-uniapp-app/static/nywz_icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
mallplusui-uniapp-app/static/shwz_icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

Loading…
Cancel
Save