Browse Source

产品列表显示修复

master
杜叶春 2 years ago
parent
commit
7f24889f22
  1. 5
      app.json
  2. 5
      app.wxss
  3. BIN
      images/delete.png
  4. BIN
      images/grxx.png
  5. BIN
      images/icon_xiahua.png
  6. BIN
      images/syss.png
  7. BIN
      images/xjt.png
  8. BIN
      images/zhiding.png
  9. 11
      pages/article/article.js
  10. 170
      pages/chooseArea/chooseArea.js
  11. 4
      pages/chooseArea/chooseArea.json
  12. 46
      pages/chooseArea/chooseArea.wxml
  13. 153
      pages/chooseArea/chooseArea.wxss
  14. 19
      pages/distribution/detail.js
  15. 7
      pages/group_buy/detail.js
  16. 98
      pages/index/index.js
  17. 3
      pages/index/index.json
  18. 74
      pages/index/index.wxml
  19. 237
      pages/index/index.wxss
  20. 10
      pages/listdetail/listdetail.js
  21. 3
      pages/listdetail/listdetail.json
  22. 66
      pages/login/login.js
  23. 11
      pages/login/login.wxml
  24. 47
      pages/login/login.wxss
  25. 68
      pages/login/register.js
  26. 3
      pages/login/register.json
  27. 5
      pages/login/register.wxml
  28. 19
      pages/login/register.wxss
  29. 66
      pages/mchList/mchList.js
  30. 6
      pages/mchList/mchList.json
  31. 2
      pages/mchList/mchList.wxml
  32. 1
      pages/mchList/mchList.wxss
  33. 112
      pages/new/new.js
  34. 2
      pages/new/new.json
  35. 53
      pages/new/new.wxml
  36. 103
      pages/new/new.wxss
  37. 19
      pages/product/detail.js
  38. 2
      pages/product/detail.wxml
  39. 6
      pages/set/set.js
  40. 14
      utils/server.js

5
app.json

@ -45,7 +45,10 @@
"pages/live/index", "pages/live/index",
"pages/distribution/list", "pages/distribution/list",
"pages/distribution/user", "pages/distribution/user",
"pages/distribution/detail" "pages/distribution/detail",
"pages/mchList/mchList",
"pages/chooseArea/chooseArea",
"pages/login/register"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",

5
app.wxss

@ -10,11 +10,8 @@ page {
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box; box-sizing: border-box;
font-family: '微软雅黑' font-family: '微软雅黑';
} }
.df{ .df{
display: -webkit-box; display: -webkit-box;

BIN
images/delete.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
images/grxx.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
images/icon_xiahua.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

BIN
images/syss.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

BIN
images/xjt.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 B

After

Width:  |  Height:  |  Size: 605 B

BIN
images/zhiding.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

11
pages/article/article.js

@ -180,16 +180,7 @@ Page({
wx.getSetting({ wx.getSetting({
success(res) { success(res) {
console.log(res) console.log(res)
if (!res.authSetting['scope.writePhotosAlbum']) {
wx.authorize({
scope: 'scope.writePhotosAlbum',
success() {
console.log('授权成功')
}
})
} else {
console.log('qqqqq')
}
} }
}) })

170
pages/chooseArea/chooseArea.js

@ -0,0 +1,170 @@
// pages/chooseArea/chooseArea.js
var app = getApp();
var WXAPI = require('../../utils/server.js');
Page({
/**
* 页面的初始数据
*/
data: {
searchKey: '',
city_list: {},
area_list: [],
choose_area: [],
seeAreaFlag: false,
filterKey: '',
level: 0,
region: '',
GroupID: '',
titleKey: 'A',
scrollKey: 'A',
},
getLocation(groupID) {
var that = this;
WXAPI.getLocation({
accessId: app.globalData.accessId,
GroupID: groupID
}).then(res => {
if (res.code == 200) {
var data = res.data
that.setData({
city_list: data.list,
area_list: data.xian,
})
}
});
},
seeAreaClick(){
var that = this;
that.setData({
seeAreaFlag: !that.data.seeAreaFlag
})
},
searchInput: function(e) {
this.setData({
searchKey: e.detail.value
})
},
cleardata() {
console.log('1111')
this.setData({
searchKey: ''
})
},
search() {
var that = this;
var result_list = []
var city_list = that.data.city_list
for (var i = 0; i < city_list.length; i++) {
city_list[i].filter(item=>{
if(item.G_CName.includes(that.data.searchKey)) {
result_list.push(item)
}
})
}
that.setData({
filterKey: that.data.searchKey,
city_list: result_list
})
},
changeTitle(e){
var that = this;
that.setData({
titleKey: e.currentTarget.dataset.key,
scrollKey: e.currentTarget.dataset.key,
})
},
clickArea(e){
var that = this;
var data = e.currentTarget.dataset
// var choose_area = []
// that.setData({
// choose_area: choose_area.splice(0,1,data.item),
// GroupID: data.item.GroupID
// })
// that.data.choose_area = choose_area.splice(0,1,data.item)
var region = {
city: data.item.G_CName,
city_GroupID: data.item.GroupID,
// district: that.data.choose_area[1].G_CName,
// district_GroupID: that.data.choose_area[1].GroupID,
}
wx.setStorageSync('region',region)
// that.getLocation(that.data.choose_area[1].GroupID)
wx.navigateBack()
},
contentScroll(e){
var offset = e.detail.scrollTop;
var lineHeight;
var that = this;
var cityarr = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'W', 'X', 'Y', 'Z']
var city_list = that.data.city_list
// for (var i in cityarr) {
// lineHeight = city_list[cityarr[i]].length*40;
// }
var index = parseInt(offset / 660);
that.setData({
titleKey: cityarr[index]
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
var that = this;
var region = wx.getStorageSync('region')
that.setData({
region: region,
})
that.getLocation(region.city_GroupID)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

4
pages/chooseArea/chooseArea.json

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "选择地区"
}

46
pages/chooseArea/chooseArea.wxml

@ -0,0 +1,46 @@
<!--pages/chooseArea/chooseArea.wxml-->
<view class="container">
<view class="topBox">
<view class="searchBox">
<view class="searchBox_left">
<image class='searchImg' src="/images/icon-search.png"></image>
<input type="text" value="{{searchKey}}" placeholder="请输入城市名称" bindinput="searchInput"/>
<view wx:if="{{searchKey}}" bindtap="cleardata">
<image class="cancel" src="/images/delete.png" mode=""></image>
</view>
</view>
<view class="searchBox_btn" bindtap="search">搜索</view>
</view>
<view class="area">
<view class="area_left">
<text>当前位置:</text>
<view class="area_left_item" wx:if="{{choose_area.length>0}}">
<text wx:for="{{choose_area}}" wx:key="index">{{item.G_CName}}</text>
</view>
<view wx:else>{{region.city}}</view>
</view>
<view class="area_right" bindtap="seeAreaClick">
<text>切换区县</text>
<image src="/images/xjt.png"></image>
</view>
</view>
<view class="areaItemBox" wx:if="{{seeAreaFlag}}">
<view class="areaItem" wx:for="{{area_list}}" wx:key="index" data-item="{{item}}" bindtap="clickArea">{{item.G_CName}}</view>
</view>
</view>
<scroll-view class="content" scroll-y="true" bindscroll="contentScroll" scroll-into-view="{{scrollKey}}" scroll-with-animation="true">
<view class="list-table" wx:for="{{city_list}}" id="{{index}}" wx:key="index">
<view class="listTitle" wx:if="{{!filterKey}}">{{index}}</view>
<view wx:for="{{city_list[index]}}" wx:key="index">
<view class="list" wx:if="{{!item.G_CName.includes(filterKey)}}" wx:key="index" data-item="{{item}}" bindtap="clickArea">{{item.G_CName}}</view>
</view>
</view>
<view class="listRight" wx:if="{{!filterKey}}">
<view wx:for="{{city_list}}" wx:key="key" class="{{index == titleKey?'active': ''}}" data-key="{{index}}" bindtap="changeTitle">{{index}}</view>
</view>
</scroll-view>
</view>

153
pages/chooseArea/chooseArea.wxss

@ -0,0 +1,153 @@
/* pages/chooseArea/chooseArea.wxss */
.container{
display: flex;
flex-direction: column;
height: 100vh;
overflow: hidden;
}
.searchBox{
display: flex;
width: 100%;
padding: 6rpx 0 17rpx 30rpx;
box-sizing: border-box;
background-color: #fff;
}
.searchBox_btn{
display: flex;
align-items: center;
justify-content: center;
height: 68rpx;
padding: 0 30rpx 0 20rpx;
font-size: 28rpx;
}
.searchBox .searchBox_left {
position: relative;
flex: 1;
display: flex;
align-items: center;
height: 68rpx;
border-radius: 40rpx;
padding-left: 69rpx;
box-sizing: border-box;
background-color: #F4F5F6;
}
.searchBox_left image{
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 20rpx;
width: 30rpx;
height: 30rpx;
}
.searchBox_left .cancel{
width: 35rpx;
height: 35rpx;
left: 570rpx;
z-index: 10;
}
.searchBox_left input{
width: 100%;
font-size: 28rpx;
color: #020202;
}
.area{
display: flex;
align-items: center;
height: 84rpx;
padding: 0 30rpx;
font-size: 28rpx;
}
.area_left{
display: flex;
align-items: center;
}
.area_left_item{
max-width: 370rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.area_right{
display: flex;
align-items: center;
margin-left: auto;
}
.area_right text{
font-size: 26rpx;
color: #666666;
}
.area_right image{
width: 20rpx;
height: 12rpx;
margin-left: 10rpx;
}
.areaItemBox{
display: flex;
flex-wrap: wrap;
padding: 12rpx 0 0 30rpx;
max-height: 450rpx;
overflow-y: auto;
}
.areaItemBox .areaItem{
display: flex;
align-items: center;
justify-content: center;
min-width: 210rpx;
padding: 0 20rpx;
height: 80rpx;
background: #FFFFFF;
border: 1px solid #E6E6E6;
border-radius: 4rpx;
box-sizing: border-box;
margin-right: 30rpx;
margin-bottom: 30rpx;
font-size: 28rpx;
color: #0F0F1C;
}
.areaItemBox .areaItem.active{
background-color: #F4F4F4;
}
.content{
position: relative;
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
.content .listRight{
position: fixed;
right: 0;
top: 260rpx;
}
.listRight view{
font-size: 24rpx;
padding: 8rpx 18rpx;
color: #999999;
}
.listRight view.active{
color: #020202;
}
.content .listTitle{
display: flex;
align-items: center;
height: 54rpx;
background: #F8F8F8;
padding: 0 30rpx;
font-size: 30rpx;
color: #999999;
}
.content .list{
display: flex;
align-items: center;
height: 80rpx;
padding: 0 30rpx;
margin-right: 70rpx;
font-size: 30rpx;
border-bottom: 1px solid #E6E6E6;
}
.content .list.active{
background-color: #F4F4F4;
}

19
pages/distribution/detail.js

@ -885,26 +885,7 @@ Page({
success(res) { success(res) {
if (!res.authSetting['scope.writePhotosAlbum']) { if (!res.authSetting['scope.writePhotosAlbum']) {
wx.authorize({
scope: 'scope.writePhotosAlbum',
success() {
console.log('授权成功')
},
fail: function (res) {
wx.openSetting({
success: (res) => {
res.authSetting = {
"scope.userInfo": true,
"scope.userLocation": true,
"scope.writePhotosAlbum": true
}
}
})
}
})
} else { } else {
} }

7
pages/group_buy/detail.js

@ -795,12 +795,7 @@ Page({
success(res) { success(res) {
console.log(res) console.log(res)
if (!res.authSetting['scope.writePhotosAlbum']) { if (!res.authSetting['scope.writePhotosAlbum']) {
wx.authorize({
scope: 'scope.writePhotosAlbum',
success() {
console.log('授权成功')
}
})
} else { } else {
console.log('qqqqq') console.log('qqqqq')
} }

98
pages/index/index.js

@ -6,6 +6,7 @@ var WXAPI = require('../../utils/server.js');
var util = require('../../utils/util.js') var util = require('../../utils/util.js')
Page({ Page({
data: { data: {
barHeight: wx.getSystemInfoSync().statusBarHeight,
pop: null, pop: null,
inforList: [], //公告 inforList: [], //公告
banner: [], banner: [],
@ -30,14 +31,20 @@ Page({
zjList: {}, zjList: {},
zjList_box: false, zjList_box: false,
cart: 0, //购物车数量 cart: 0, //购物车数量
// mainHeight: 0, region: '',
latitude: 28.227965,
longitude: 112.951227,
}, },
//下拉事件 //下拉事件
onPullDownRefresh: function () { onPullDownRefresh: function () {
var that = this; var that = this;
that.getMore(); that.getMore();
}, },
navToArea: function () {
wx.navigateTo({
url: "../chooseArea/chooseArea?"
})
},
imgW: function (e) { imgW: function (e) {
var $width = e.detail.width, //获取图片真实宽度 var $width = e.detail.width, //获取图片真实宽度
$height = e.detail.height, $height = e.detail.height,
@ -68,22 +75,21 @@ Page({
}).then(res => { }).then(res => {
if (res.code == 200) { if (res.code == 200) {
var data = res.data; var data = res.data;
wx.hideNavigationBarLoading() //完成停止加载 if (data == '') {
wx.stopPullDownRefresh() //停止下拉刷新
that.setData({ that.setData({
loading: false, loading: false,
}); });
if (data == '') { return;
return false;
} else { } else {
var titleList = that.data.titleList; var titleList = that.data.titleList;
titleList[current].list.push(...prolist) titleList[current].list.push(...prolist)
var indexList = titleList[0].list
that.setData({ that.setData({
loading: false,
titleList: titleList, titleList: titleList,
indexList: indexList
}); });
} }
wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新
} }
}); });
}, },
@ -150,34 +156,21 @@ Page({
loadProductDetail: function () { loadProductDetail: function () {
var that = this; var that = this;
// var userinfo = wx.getStorageSync('userInfo'); // var userinfo = wx.getStorageSync('userInfo');
// if (userinfo.nickName) {
// app.globalData.userInfo = userinfo;
// }
// var openid = app.globalData.userInfo.openid ? app.globalData.userInfo.openid : false;
// var user_id = '';
// if (openid) {
// user_id = app.globalData.userInfo.user_id;
// }
WXAPI.homeIndex({ WXAPI.homeIndex({
accessId: app.globalData.accessId, accessId: app.globalData.accessId,
storeId: 239, storeId: 239,
storeType: 1, storeType: 1,
latitude: 28.227965, latitude: that.data.latitude,
longitude: 112.951227, longitude: that.data.longitude,
}).then(res => { }).then(res => {
if (res.code == 200) { if (res.code == 200) {
var data = res.data; var data = res.data;
var titleList = data.list2; //标题导航栏 var titleList = data.list2; //标题导航栏
var indexList = []
if (titleList) {
indexList = titleList[0].list // 获取首页的数据对象
}
app.globalData.logoimg = data.logo app.globalData.logoimg = data.logo
that.setData({ that.setData({
inforList: data.notice, //滚动公告条 inforList: data.notice, //滚动公告条
banner: data.banner, // 轮播图 banner: data.banner, // 轮播图
titleList: titleList, titleList: titleList,
indexList: indexList,
r_mch: data.r_mch, //优选店铺 r_mch: data.r_mch, //优选店铺
plug: data.nav_list, //首页类型模块 plug: data.nav_list, //首页类型模块
mch_name: data.title, mch_name: data.title,
@ -202,7 +195,7 @@ Page({
} }
}); });
//新品上市 //新品上市
WXAPI.newArrivalIndex({ WXAPI.newArrival({
accessId: app.globalData.accessId, accessId: app.globalData.accessId,
storeId: 239, storeId: 239,
storeType: 1, storeType: 1,
@ -215,7 +208,7 @@ Page({
} }
}); });
//好物优选 //好物优选
WXAPI.recommendIndex({ WXAPI.recommend({
accessId: app.globalData.accessId, accessId: app.globalData.accessId,
storeId: 239, storeId: 239,
storeType: 1, storeType: 1,
@ -228,6 +221,24 @@ Page({
} }
}); });
}, },
navigatorAct: function(e) {
var data = e.currentTarget.dataset
wx.navigateTo({
url:"/pages/new/new?title="+data.title,
})
},
//找相似
discoverSimilarProducts: function (e) {
var goodsId = e.currentTarget.dataset;
wx.navigateTo({
// url:"/pages/detail/detail?id="+goodsId.id
})
},
navToMchList: function (e) {
wx.navigateTo({
url:"../mchList/mchList"
})
},
onHide: function () { onHide: function () {
clearTimeout(); clearTimeout();
}, },
@ -338,6 +349,9 @@ Page({
that.onLoad(); that.onLoad();
app.d.indexchase = false; app.d.indexchase = false;
} }
that.setData({
region: wx.getStorageSync('region')
})
// util.getUesrBgplus(that, app, false) // util.getUesrBgplus(that, app, false)
}, },
onReady: function () { onReady: function () {
@ -363,33 +377,6 @@ Page({
}) })
}, },
//获取用户信息新接口
agreeGetUser: function (e) {
let that = this
if (e.detail.errMsg == 'getUserInfo:ok') {
//获取成功设置状态
app.globalData.isLogin = true;
wx.setStorageSync('isLogin', true);
//设置用户信息本地存储
try {
wx.setStorageSync('userInfo', e.detail.userInfo);
} catch (e) {
wx.showToast({
title: '系统提示:网络错误!',
icon: 'warn',
duration: 1500,
})
}
wx.showLoading({
title: '加载中...',
duration: 1500,
})
that.setData({
isLogin: false
})
that.getOP(e.detail.userInfo)
}
},
login: function () { login: function () {
var that = this; var that = this;
//取出本地存储用户信息,解决需要每次进入小程序弹框获取用户信息 //取出本地存储用户信息,解决需要每次进入小程序弹框获取用户信息
@ -478,11 +465,16 @@ Page({
}) })
} }
} }
wx.navigateTo({ wx.navigateTo({
url: event.currentTarget.dataset.path, url: event.currentTarget.dataset.path,
}) })
}, },
zhiding() {
wx.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
onShareAppMessage: function (res) { onShareAppMessage: function (res) {
var that = this; var that = this;
var id = that.data.productId; var id = that.data.productId;

3
pages/index/index.json

@ -1,4 +1,5 @@
{ {
"usingComponents": {}, "usingComponents": {},
"navigationBarTitleText": "互利商城" "navigationBarTitleText": "互利商城",
"navigationStyle": "custom"
} }

74
pages/index/index.wxml

@ -58,22 +58,22 @@
</view> </view>
</view> --> </view> -->
<!-- 顶部导航栏 --> <!-- 顶部导航栏 -->
<!-- <view class="container_top_item" style="height: 88rpx;"> <view class="container_top_item" style="padding-top:{{barHeight + 40}}rpx; padding-bottom:10rpx;">
<view class="container_top_item_left" bindtap="toArea" style="white-space: nowrap;"> <view class="container_top_item_left" bindtap="navToArea">
{{region.district?region.district:'岳麓区'}} {{region.city?region.city:'常州市'}}
<image src="jianX_h" lazy-load="true"></image> <image src="/images/icon_xiahua.png" lazy-load="true"></image>
</view> </view>
<view class="container_top_item_center" bindtap="toUrl('/pagesA/search/search')"> <view class="container_top_item_center" bindtap="toUrl('/pagesA/search/search')">
<image src="syss" lazy-load="true"></image> <image src="/images/syss.png" lazy-load="true"></image>
{{language.home.search_placeholder}} 搜索你想要的商品
</view> </view>
<view class="container_top_item_right" bindtap="_navigateTo('/pages/message/systemMesage')"> <!-- <view class="container_top_item_right" bindtap="_navigateTo('/pages/message/systemMesage')">
<image src="grxx" lazy-load="true"></image> <image src="grxx" lazy-load="true"></image>
<view v-if="xxnum">{{ xxnum }}</view> <view v-if="xxnum">{{ xxnum }}</view>
</view>
</view> --> </view> -->
</view>
<!-- 顶部导航栏结束 --> <!-- 顶部导航栏结束 -->
<view class="out"> <view class="out">
@ -97,7 +97,7 @@
<!-- /首页菜单/ --> <!-- /首页菜单/ -->
<!-- wx:if="{{item.id > 0 && item.icons.length >0}}" --> <!-- wx:if="{{item.id > 0 && item.icons.length >0}}" -->
<view class="section icons"> <view class="section icons">
<navigator url="../listdetail/listdetail?class={{icons.id}}&title={{icons.name}}" hover-class="changestyle" class="icon" wx:for="{{plug}}" wx:for-item="icons" wx:key="id" data-id="{{item.id}}"> <navigator class="icon" url="../listdetail/listdetail?id={{icons.id}}&title={{icons.name}}" hover-class="changestyle" wx:for="{{plug}}" wx:for-item="icons" wx:key="id" data-id="{{icons.id}}">
<view> <view>
<image class='img' src="{{icons.appimg}}"></image> <image class='img' src="{{icons.appimg}}"></image>
</view> </view>
@ -125,8 +125,7 @@
<!-- 好物优选 --> <!-- 好物优选 -->
<view class="content_top" style="margin-bottom: 38rpx;"> <view class="content_top" style="margin-bottom: 38rpx;">
<view class="content_top-box"> <view class="content_top-box" data-title="新品上市" bindtap="navigatorAct">
<navigator url="../new/new?type=1" open-type="navigate">
<view class="content_top-box-top"> <view class="content_top-box-top">
<view class="content_top-box-top-title">新品上市</view> <view class="content_top-box-top-title">新品上市</view>
<view class="content_top-box-top-txt">上新好物优选购</view> <view class="content_top-box-top-txt">上新好物优选购</view>
@ -135,10 +134,9 @@
<image src="{{newImgList[0].imgurl}}" class="content_top-box-bottom-img"></image> <image src="{{newImgList[0].imgurl}}" class="content_top-box-bottom-img"></image>
<image wx:if="{{newImgList.length > 1}}" src="{{newImgList[1].imgurl}}" class="content_top-box-bottom-img"></image> <image wx:if="{{newImgList.length > 1}}" src="{{newImgList[1].imgurl}}" class="content_top-box-bottom-img"></image>
</view> </view>
</navigator>
</view> </view>
<view class="content_top-box"> <view class="content_top-box" data-title="好物优选" bindtap="navigatorAct">
<navigator url="../new/new?type=2" open-type="navigate"> <!-- <navigator url="../new/new?type=2" open-type="navigate"> -->
<view class="content_top-box-top"> <view class="content_top-box-top">
<view class="content_top-box-top-title">好物优选</view> <view class="content_top-box-top-title">好物优选</view>
<view class="content_top-box-top-txt">品质好物优先选</view> <view class="content_top-box-top-txt">品质好物优先选</view>
@ -147,7 +145,7 @@
<image src="{{recommendImgList[0].imgurl}}" class="content_top-box-bottom-img"></image> <image src="{{recommendImgList[0].imgurl}}" class="content_top-box-bottom-img"></image>
<image wx:if="{{recommendImgList.length > 1}}" src="{{recommendImgList[1].imgurl}}" class="content_top-box-bottom-img"></image> <image wx:if="{{recommendImgList.length > 1}}" src="{{recommendImgList[1].imgurl}}" class="content_top-box-bottom-img"></image>
</view> </view>
</navigator> <!-- </navigator> -->
</view> </view>
</view> </view>
<!-- 好物优选结束 --> <!-- 好物优选结束 -->
@ -156,14 +154,13 @@
<view class="home_title"> <view class="home_title">
<view class="mch_name">优选店铺</view> <view class="mch_name">优选店铺</view>
<image class="home_title_bg" src="/images/home_title_bg.png"></image> <image class="home_title_bg" src="/images/home_title_bg.png"></image>
<view class="more" bindtap="navTo('/pagesB/home/mchList')"> <view class="more" bindtap="navToMchList">
<text>更多</text> <text>更多</text>
<image src="/images/x_right.png" lazy-load="true"></image> <image src="/images/x_right.png" lazy-load="true"></image>
</view> </view>
</view> </view>
<view class="mch_content"> <view class="mch_content">
<!-- @tap="toUrl('/pagesB/home/mchList')" --> <view class="mch_content_item" wx:for="{{r_mch}}" wx:for-item="item" wx:key="id" bindtap="navToMchList">
<view class="mch_content_item" wx:for="{{r_mch}}" wx:for-item="item" wx:key="id">
<image src="{{item.logo}}" lazy-load="true" mode="aspectFill"></image> <image src="{{item.logo}}" lazy-load="true" mode="aspectFill"></image>
<view>{{item.name}}</view> <view>{{item.name}}</view>
<text>{{item.distance}}km</text> <text>{{item.distance}}km</text>
@ -173,9 +170,9 @@
<!-- 优选店铺结束 --> <!-- 优选店铺结束 -->
<!-- 会员权益 --> <!-- 会员权益 -->
<!-- @click="vipclick" --> <!-- @click="vipclick" -->
<view style="width: 100%;height: 200rpx;" wx:if="{{memberPlugin}}"> <!-- <view style="width: 100%;height: 200rpx;" wx:if="{{memberPlugin}}">
<image src="https://mall.gylservice.com/pic/images/icon1/member/hyrk.png" style="width: 100%;height: 100%;"></image> <image src="https://mall.gylservice.com/pic/images/icon1/member/hyrk.png" style="width: 100%;height: 100%;"></image>
</view> </view> -->
<!-- 会员权益结束 --> <!-- 会员权益结束 -->
<!-- 分类商品 --> <!-- 分类商品 -->
@ -186,7 +183,7 @@
</navigator> </navigator>
<view class="item_cont" wx:elif="{{index==0}}"> <view class="item_cont" wx:elif="{{index==0}}">
<block wx:for="{{indexList}}" wx:for-item="item" wx:key="id"> <block wx:for="{{indexList}}" wx:for-item="item" wx:key="id">
<navigator class="pr" url="../product/detail?productId={{item.id}}" hover-class="changestyle"> <navigator class="productView" url="../product/detail?productId={{item.id}}" hover-class="changestyle">
<image class="photo" src="{{item.imgurl}}"></image> <image class="photo" src="{{item.imgurl}}"></image>
<view class="title">{{item.product_title}}</view> <view class="title">{{item.product_title}}</view>
<view style="display:flex;line-height:50rpx;"> <view style="display:flex;line-height:50rpx;">
@ -216,20 +213,21 @@
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<block wx:for="{{item.list}}" wx:for-item="list" wx:key="id"> <block wx:for="{{titleList[current].list}}" wx:for-item="list" wx:key="id">
<navigator class="pr" url="../product/detail?productId={{list.id}}" hover-class="changestyle"> <navigator class="productView" url="../product/detail?productId={{list.id}}" hover-class="changestyle">
<image class="photo" src="{{list.imgurl}}"></image> <image class="photo" src="{{list.imgurl}}"></image>
<view class="title">{{list.product_title}}</view> <view class="title">{{list.product_title}}</view>
<view style="display:flex;line-height:50rpx;"> <view class="gstatus">{{list.s_type_list[0].name}}</view>
<view class="gmxx" style="font-size:28rpx;width:80%"> <view style="display:flex;line-height:50rpx;color:#999">
<text style="padding:0px 2px;" wx:if="{{list.xp == 1}}">新品</text> <view class="gmxx">¥ {{list.price}}</view>
<text style="padding:0px 2px;" wx:if="{{list.rexiao == 1}}">热销</text> <view class="ku">已售{{list.volume}}件</view>
<text style="padding:0px 2px;" wx:if="{{list.tuijian == 1}}">推荐</text>
</view> </view>
<view style="display:flex;">
<view class="goods_shopBox">
<image class="goods_shop" src="{{list.logo}}"></image>
<text>{{list.mch_name}}</text>
</view> </view>
<view style="display:flex;line-height:50rpx;color:#999"> <view class="discover" data-id="{{list.id}}" bindtap="discoverSimilarProducts">找相似</view>
<view class="gmxx" style=" color: red;">¥ {{list.price}}</view>
<view class="ku" style="width:60%">销量:{{list.volume}}</view>
</view> </view>
</navigator> </navigator>
</block> </block>
@ -259,11 +257,12 @@
</view> </view>
</view> </view>
<view wx:if="{{titleList[current].list == ''}}" class='tishi'> <!-- wx:if="{{titleList[current].list == ''}}" -->
<view> <view class='tishi'>
<!-- <view>
<image class='scimg' style="margin-top: 15%;margin-bottom: 5%;" src='/images/search_no.png'></image> <image class='scimg' style="margin-top: 15%;margin-bottom: 5%;" src='/images/search_no.png'></image>
</view> </view> -->
<view style='font-size:13px;color:#666;padding-bottom:50rpx'>没有更多数据了</view> <view style='font-size:27rpx;color:#999;padding-top:20rpx;padding-bottom:50rpx;font-family: serif;'>~ 我是有底线的 ~</view>
</view> </view>
</scroll-view> </scroll-view>
@ -275,13 +274,14 @@
<view class='zjList'> <view class='zjList'>
<view class="swiper_item"> <view class="swiper_item">
<image src='{{headimgurl}}' class='zjList_img'></image> <image src='{{headimgurl}}' class='zjList_img'></image>
恭喜{{user_name}}获得{{pname}}</view> 恭喜{{user_name}}获得{{pname}}
</view>
</view> </view>
</view> </view>
</block> </block>
</view> </view>
<image class="zhiding" src="/images/zhiding.png" bindtap="zhiding"></image>
<!--模态弹窗--> <!--模态弹窗-->
<view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view> <view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>
<view class="modalDlg" wx:if="{{showModal && sign_status == 1}}"> <view class="modalDlg" wx:if="{{showModal && sign_status == 1}}">

237
pages/index/index.wxss

@ -1,3 +1,16 @@
page {
flex-direction: column;
height: 100%;
width: 100%;
display:flex;
background-color:#f4f5f6;
overflow-y: auto;
/* font-family: serif; */
}
.page{
height:100%;
width:100%;
}
.in_news{ .in_news{
width:95%; width:95%;
height:80rpx; height:80rpx;
@ -35,51 +48,12 @@
display:block; display:block;
} }
.clearfix{
clear: both;
}
.vipBlock{
background-color: #fff;
height: 60rpx;
line-height: 60rpx;
width: 95%;
margin: 0 auto;
margin-bottom: 16rpx;
box-shadow: 3px 3px 3px #ccc;
}
.vipText1{
float: left;
color: #000;
font-size: 28rpx;
padding-left: 10rpx;
}
.vipText2{
float: right;
height:80%;
position:relative;
top:10%;
text-align:center;
font-size:24rpx;
background-color:pink;
border-radius:10rpx;
line-height:48rpx;
margin-right:10rpx;
display:flex;
justify-content:center;
padding:0 10px;
}
.dot{ .dot{
width: 25rpx; width: 25rpx;
height: 8rpx; height: 8rpx;
margin-right: 20rpx; margin-right: 20rpx;
background-color: white; background-color: white;
} }
.activeD{
width: 25rpx;
height: 8rpx;
background-color: coral;
}
.dots{ .dots{
width: 156rpx; width: 156rpx;
height: 36rpx; height: 36rpx;
@ -100,7 +74,6 @@
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.search-icon1{ .search-icon1{
width: 40rpx; width: 40rpx;
@ -108,19 +81,84 @@
display: inline-block; display: inline-block;
margin: 0 auto; margin: 0 auto;
} }
page {
flex-direction: column; .container_top_item {
height: 100%; position: fixed;
width: 100%; display: flex;
align-items: center;
height: 190rpx;
padding: 0rpx 30rpx;
box-sizing: border-box;
z-index: 999;
background: transparent;
width: 100vw;
background-color: #fff;
/* background-color: #f4f5f6; */
}
.container_top_item_left {
display: flex; display: flex;
align-items: center;
color: #000000;
font-size: 32rpx;
white-space: nowrap;
}
.container_top_item_left image {
width: 30rpx;
height: 30rpx;
margin-left: 6rpx;
}
.container_top_item_center {
/* search */
display: flex;
align-items: center;
width: 350rpx;
height: 66rpx;
padding: 0 20rpx;
border-radius: 33rpx;
margin-left: 20rpx;
box-sizing: border-box;
font-size: 24rpx;
color: #999999;
/* background-color: #fff; */
background-color: #f4f5f6; background-color: #f4f5f6;
overflow-y: auto;
} }
.page{
height:100%; .container_top_item_center image {
width:100%; width: 32rpx;
height: 32rpx;
margin-right: 13rpx;
} }
.container_top_item_right {
display: flex;
align-items: center;
justify-content: center;
position: relative;
margin-left: 20rpx;
width: 66rpx;
height: 66rpx;
/* // background: rgba(255, 255, 255, 1); */
border-radius: 33rpx;
}
.container_top_item_right image {
width: 48rpx;
height: 48rpx;
}
.container_top_item_right view {
position: absolute;
right: -7rpx;
top: 6rpx;
padding: 4rpx 6rpx;
background: #fa5151;
border-radius: 12rpx;
font-size: 22rpx;
line-height: 16rpx;
color: #FFFFFF;
}
.tab-h{ .tab-h{
height: 100rpx; height: 100rpx;
width: 100%; width: 100%;
@ -174,15 +212,17 @@ scroll-view{
} }
.out{ .out{
padding-top: 190rpx;
flex: auto; flex: auto;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
swiper { swiper {
margin-top: 20rpx;
display:block; display:block;
width: 100%; width: 100%;
margin: 0 auto; /* margin: 0 auto; */
height:150px; height:150px;
} }
.swiper-box{ .swiper-box{
@ -253,29 +293,15 @@ swiper {
margin: 0 auto; margin: 0 auto;
/* padding-top: 10rpx; */ /* padding-top: 10rpx; */
} }
.cont_0 { .cont .productView {
width: 100%;
}
.cont_0 .pr {
margin-bottom:10px;
background:#fff;
display:inline-block;
width:46%;
margin-left:20rpx;
}
.cont_0_box{
padding:5px 0;
text-align:center;
color:#333;
background:#fff;
}
.cont .pr {
margin-bottom:10px; margin-bottom:10px;
background:#fff; background:#fff;
display:inline-block; display:inline-block;
width:46%; width:46%;
margin-left:20rpx; margin-left:20rpx;
font-size:13px; font-size:13px;
border-radius: 10rpx;
overflow: hidden;
} }
.cont_image { .cont_image {
width: 100%; width: 100%;
@ -285,34 +311,43 @@ swiper {
.cont .title { .cont .title {
font-size: 28rpx; font-size: 28rpx;
color: #333; color: #333;
line-height: 20px; line-height: 28px;
margin: 0; margin: 0;
height: 40px; max-height: 60rpx;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
padding: 1% 5% 0 5%; padding: 0 20rpx 0 20rpx;
} }
.cont .gstatus{
.cont .tit { color: #999;
/*height: 80rpx;*/ font-size: 21rpx;
font-size: 12px; margin: 5rpx 20rpx 10rpx 20rpx;
color: #333; /* border-radius: 40rpx; */
line-height: 20px; padding: 3rpx 5rpx;
margin: 0; height: 25rpx;
max-height: 40px; width: 45rpx;
overflow: hidden; line-height: 25rpx;
text-overflow: ellipsis; text-align: center;
display: -webkit-box; border: 1rpx solid #999;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
padding: 1% 5% 0 5%;
/*color: #ccc*/
} }
.discover{
display: flex;
align-items: center;
justify-content: center;
width:90rpx;
height:36rpx;
background:#FA9D3B;
border-radius:10rpx 0rpx 0rpx 0rpx;
margin-left: auto;
margin-top: auto;
font-size: 22rpx;
color: #ffffff;
}
.photo{ .photo{
height:345rpx; height:345rpx;
width:100%; width:100%;
@ -362,17 +397,30 @@ swiper {
font-family: '\5FAE\8F6F\96C5\9ED1', arial, "\5b8b\4f53"; font-family: '\5FAE\8F6F\96C5\9ED1', arial, "\5b8b\4f53";
} }
.gmxx{ .gmxx{
font-size: 14px; font-size: 15px;
color: #d9002f; color: #fa5151;
/*padding-top: 10px; */ /*padding-top: 10px; */
} }
.ku{ .ku{
text-align: right; text-align: right;
width: 50%; font-size: 26rpx; width: 50%;
font-size: 23rpx;
margin-right:10rpx;
color: #999;
}
.goods_shopBox{
display: flex;
align-items: center;
margin: 15rpx 20rpx 15rpx;
font-size: 20rpx;
color: #1d1313;
}
.goods_shopBox .goods_shop{
width: 30rpx;
height: 30rpx;
border-radius: 50%;
margin-right: 10rpx; margin-right: 10rpx;
color: #666;
} }
.section { .section {
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
@ -799,8 +847,8 @@ margin-left: 24rpx;
margin-right: 8rpx; margin-right: 8rpx;
} }
.mch_content_item image{ .mch_content_item image{
width:198rpx; width:150rpx;
height:216rpx; height:150rpx;
border-radius:10rpx 10rpx 0rpx 0rpx; border-radius:10rpx 10rpx 0rpx 0rpx;
} }
.mch_content_item view{ .mch_content_item view{
@ -921,3 +969,10 @@ margin-left: 24rpx;
white-space: nowrap; white-space: nowrap;
font-family: serif; font-family: serif;
} }
.zhiding{
position: fixed;
right: 30rpx;
bottom: 8%;
width: 104rpx;
height: 104rpx;
}

10
pages/listdetail/listdetail.js

@ -51,14 +51,14 @@ Page({
} }
}, },
onLoad: function (options) { onLoad: function (options) {
var objectId = options.class; var objectId = options.id;
var title = options.title; var title = options.title;
//页面初始化 options为页面跳转所带来的参数 //页面初始化 options为页面跳转所带来的参数
if (objectId || title) { if (objectId || title) {
wx.setNavigationBarColor({ // wx.setNavigationBarColor({
frontColor: app.d.frontColor,// // frontColor: app.d.frontColor,//
backgroundColor: app.d.bgcolor //页面标题为路由参数 // backgroundColor: app.d.bgcolor //页面标题为路由参数
}) // })
//更改头部标题 //更改头部标题
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: options.title, title: options.title,

3
pages/listdetail/listdetail.json

@ -1,3 +1,4 @@
{ {
"usingComponents": {},
"navigationBarTitleText": ""
} }

66
pages/login/login.js

@ -121,7 +121,12 @@ Page({
password: e.detail.value password: e.detail.value
}) })
}, },
login: function () { forgetAct() {
wx.navigateTo({
url: '/pages/login/register?name=找回密码',
})
},
loginAct: function () {
var that = this; var that = this;
WXAPI.login({ WXAPI.login({
storeId: 239, storeId: 239,
@ -135,10 +140,10 @@ Page({
wx.setStorageSync('isLogin', true); wx.setStorageSync('isLogin', true);
wx.setStorageSync('userInfo', data.data); wx.setStorageSync('userInfo', data.data);
wx.navigateBack() wx.navigateBack()
// wx.showToast({ wx.showToast({
// title: '登录成功!', title: '登录成功!',
// success: 2000 success: 2000
// }); });
} else { } else {
wx.showToast({ wx.showToast({
title: res.message, title: res.message,
@ -147,52 +152,11 @@ Page({
}) })
} }
}); });
},
registerAct() {
// wx.login({ wx.navigateTo({
// success: res => { url: '/pages/login/register?name=注册',
// app.globalData.code = res.code })
// wx.setStorageSync('code', res.code)
// },
// fail: function () {
// wx.showToast({
// title: '系统提示:网络错误!',
// icon: 'warn',
// duration: 1500,
// })
// }
// })
// wx.getSetting({
// success: (res) => {
// //没有授权需要弹框
// if (!res.authSetting['scope.userInfo']) {
// that.setData({
// isLogin: true
// });
// } else {
// //判断用户已经授权。不需要弹框
// if (app.globalData.isLogin) {
// that.setData({
// isLogin: false
// })
// app.globalData.isLogin = true;
// wx.setStorageSync('isLogin', true);
// } else {
// that.setData({
// isLogin: true
// });
// }
// }
// },
// fail: function () {
// wx.showToast({
// title: '系统提示:网络错误!',
// icon: 'warn',
// duration: 1500,
// })
// }
// })
}, },
getOP: function (res) { getOP: function (res) {
//提交用户信息 获取用户id //提交用户信息 获取用户id

11
pages/login/login.wxml

@ -1,11 +1,11 @@
<!--pages/index/index.wxml--> <!--pages/index/index.wxml-->
<view class="page"> <view class="page">
<view class="top-tab"> <!-- <view class="top-tab">
<view class="top-tab-item{{currentIndex==idx?'Active':''}}" wx:key="key" wx:for="{{navTab}}" wx:for-index="idx" wx:for-item="item" data-idx='{{idx}}' data-item='{{item}}' bindtap="switchTab">{{item.type}} <view class="top-tab-item{{currentIndex==idx?'Active':''}}" wx:key="key" wx:for="{{navTab}}" wx:for-index="idx" wx:for-item="item" data-idx='{{idx}}' data-item='{{item}}' bindtap="switchTab">{{item.type}}
<view class="top-tab-line{{currentIndex==idx?'Active':''}}"></view> <view class="top-tab-line{{currentIndex==idx?'Active':''}}"></view>
</view> </view>
</view> </view> -->
<!--密码登录--> <!--密码登录-->
<view class='login'> <view class='login'>
@ -20,18 +20,17 @@
<input placeholder="请输入密码" type="password" bindinput="passwordInput" /> <input placeholder="请输入密码" type="password" bindinput="passwordInput" />
</view> </view>
<!-- <button open-type="getPhoneNumber" hidden="{{false}}" lang="zh_CN" bindgetphonenumber="bindPhoneNumber">微信一键登录</button> --> <!-- <button open-type="getPhoneNumber" hidden="{{false}}" lang="zh_CN" bindgetphonenumber="bindPhoneNumber">微信一键登录</button> -->
<view class="loginView" bindtap="login">登录</view> <view class="forgetView" bindtap="forgetAct">忘记密码?</view>
<view class="loginView" bindtap="loginAct">登录</view>
<view class="registerView" bindtap="registerAct">注册</view>
</view> </view>
<!--验证码登录--> <!--验证码登录-->
<!-- <view class="ather_login"> <!-- <view class="ather_login">
<view>—— 其他登录方式 ——</view> <view>—— 其他登录方式 ——</view>
<view> <view>
<image :src="wx"></image> <image :src="wx"></image>
</view> </view>
</view> --> </view> -->
</view> </view>

47
pages/login/login.wxss

@ -45,14 +45,15 @@ page{
} }
.login{ .login{
display: flex; display: flex;
flex-direction:column;
} }
/* 图片+输入框+下划线的父容器view */ /* 图片+输入框+下划线的父容器view */
.userCs{ .userCs{
margin-top: 50rpx; margin-top: 50rpx;
margin-left: 25rpx; margin-left: 30rpx;
position: absolute; position: absolute;
display: flex; display: flex;
width:700rpx ; width:690rpx ;
height: 110rpx ; height: 110rpx ;
background-color: white; background-color: white;
border-radius: 20rpx; border-radius: 20rpx;
@ -75,10 +76,10 @@ page{
/* 密码图标+输入框+小眼睛图标+下划线父容器view */ /* 密码图标+输入框+小眼睛图标+下划线父容器view */
.passwordCs{ .passwordCs{
margin-top: 190rpx; margin-top: 190rpx;
margin-left: 25rpx; margin-left: 30rpx;
position: absolute; position: absolute;
display: flex; display: flex;
width:700rpx ; width:690rpx ;
height: 110rpx ; height: 110rpx ;
background-color: white; background-color: white;
border-radius: 20rpx; border-radius: 20rpx;
@ -105,13 +106,25 @@ page{
margin-left: 30rpx; margin-left: 30rpx;
line-height: 55rpx; line-height: 55rpx;
} }
/* 忘记密码 */
.forgetView{
position: absolute;
margin-top: 325rpx;
right: 30rpx;
width: 150rpx;
height: 40rpx;
color: gray;
font-size: 25rpx;
display: flex;
align-items: center;
justify-content: center;
}
.loginView{ .loginView{
/* margin: 300rpx 90rpx 25rpx; */ /* margin: 300rpx 90rpx 25rpx; */
margin-top: 380rpx; margin-top: 410rpx;
margin-left: 25rpx; margin-left: 30rpx;
width: 700rpx; width: 690rpx;
height: 85rpx; height: 80rpx;
background-color:#F95B43; background-color:#F95B43;
border-radius: 20rpx; border-radius: 20rpx;
font-size: 32rpx; font-size: 32rpx;
@ -120,3 +133,19 @@ page{
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.registerView{
margin-top: 30rpx;
margin-left: 30rpx;
width: 690rpx;
height: 80rpx;
/* background-color:white; */
border-radius: 20rpx;
border-color: #F95B43;
border-style:solid;
border-width:2rpx;
font-size: 32rpx;
color: #F95B43;
display: flex;
align-items: center;
justify-content: center;
}

68
pages/login/register.js

@ -0,0 +1,68 @@
// pages/login/register.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.setNavigationBarTitle({
title: options.name,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

3
pages/login/register.json

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

5
pages/login/register.wxml

@ -0,0 +1,5 @@
<!--pages/login/register.wxml-->
<view class="container">
<image class="codeImage" src="/images/red_packet_share.png" mode="aspectFill"></image>
<view class="title">请添加上方二维码联系客服注册账号</view>
</view>

19
pages/login/register.wxss

@ -0,0 +1,19 @@
/* pages/login/register.wxss */
page{
background-color: #F4F5F6;
}
.container{
font-size: 30rpx;
width: 100%;
align-items: center;
}
.codeImage{
margin-top: 60rpx;
width: 320rpx;
height: 320rpx;
}
.title{
margin-top: 30rpx;
height: 60rpx;
line-height: 60rpx;
}

66
pages/mchList/mchList.js

@ -0,0 +1,66 @@
// pages/mchList/mchList.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

6
pages/mchList/mchList.json

@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTitleText": "优选店铺",
"navigationBarBackgroundColor": "#FA5151",
"navigationBarTextStyle": "white"
}

2
pages/mchList/mchList.wxml

@ -0,0 +1,2 @@
<!--pages/mchList/mchList.wxml-->
<text>pages/mchList/mchList.wxml</text>

1
pages/mchList/mchList.wxss

@ -0,0 +1 @@
/* pages/mchList/mchList.wxss */

112
pages/new/new.js

@ -13,6 +13,7 @@ Page({
brandId: 0, brandId: 0,
heng:'xs',//控制显示方式 heng:'xs',//控制显示方式
shu:'bxs', shu:'bxs',
logoUrl: "https://cz-hl-shop.oss-cn-shanghai.aliyuncs.com/239/1/20230227/",
xianshi:'icon-yduipaibanleixingliebiao', xianshi:'icon-yduipaibanleixingliebiao',
imageurl1: "../../images/mo.png",//默认排序图 imageurl1: "../../images/mo.png",//默认排序图
daindex1: 0, daindex1: 0,
@ -24,28 +25,11 @@ Page({
sort: 0,// 1 asc 升序 0 desc 降序 sort: 0,// 1 asc 升序 0 desc 降序
}, },
onPullDownRefresh: function () { onPullDownRefresh: function () {
wx.showNavigationBarLoading() //在标题栏中显示加载
var that = this; var that = this;
var objectId = that.data.objectId; var objectId = that.data.objectId;
var select = that.data.select; var select = that.data.select;
var sort = that.data.sort; var sort = that.data.sort;
WXAPI.newProduct({ that.getMore();
page: 1,
cid: 1,
select: select,
sort: sort,
}).then(res => {
if (res.code == 200) {
var data = res;
that.setData({
shopList: data.pro,
page:2,
period: false
})
wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新
}
});
}, },
/* tab */ /* tab */
choosesort1: function (e) { choosesort1: function (e) {
@ -176,17 +160,15 @@ Page({
var select = that.data.select; var select = that.data.select;
var sort = that.data.sort; var sort = that.data.sort;
var page = that.data.page; var page = that.data.page;
//ajax请求数据 WXAPI.newArrival({
WXAPI.newProduct({ accessId: app.globalData.accessId,
cid: 1, storeId: 239,
select: select, storeType: 1,
sort: sort,
page: page
}).then(res => { }).then(res => {
if (res.code == 200) { if (res.code == 200) {
var data = res; var data = res.data;
that.setData({ that.setData({
shopList: data.pro, shopList: data.list,
page: page+1 page: page+1
}) })
} }
@ -206,29 +188,70 @@ Page({
that.setData({ that.setData({
page: page+1 page: page+1
}); });
WXAPI.newProduct({ if (that.data.title == '新品上市') {
page: page, that.getNewArrival()
cid: 1, } else {
select: select, that.getRecommend()
sort: sort, }
},
//新品上市
getNewArrival() {
var that = this;
wx.showNavigationBarLoading() //在标题栏中显示加载
WXAPI.newArrival({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
}).then(res => { }).then(res => {
if (res.code == 200) { if (res.code == 200) {
var data = res; var data = res.data;
if (data.pro == '' || data.status == 0) { //成功返回设置数据
if (data == '') {
that.setData({
loading: false,
});
return;
} else {
that.setData({ that.setData({
period: true, remind: '',
loading:false loading:false,
shopList: data.list
// shopList: that.data.shopList.concat(data.list)
}); });
return false;
} }
wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新
}
});
},
//好物优选
getRecommend() {
var that = this;
wx.showNavigationBarLoading() //在标题栏中显示加载
WXAPI.recommend({
accessId: app.globalData.accessId,
storeId: 239,
storeType: 1,
}).then(res => {
if (res.code == 200) {
var data = res.data;
//成功返回设置数据 //成功返回设置数据
if (data == '') {
that.setData({
loading: false,
});
return;
} else {
that.setData({ that.setData({
remind: '', remind: '',
loading:false, loading:false,
shopList: that.data.shopList.concat(data.pro) shopList: data.list
// shopList: that.data.shopList.concat(data.list)
}); });
} }
wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新
}
}); });
}, },
onShow: function () { onShow: function () {
@ -244,13 +267,16 @@ Page({
}, },
onLoad: function (options) { onLoad: function (options) {
wx.setNavigationBarTitle({
title: options.title,
})
this.setData({ this.setData({
bgcolor: app.d.bgcolor, title: options.title,
}); });
wx.setNavigationBarColor({ // wx.setNavigationBarColor({
frontColor: app.d.frontColor,// // frontColor: app.d.frontColor,//
backgroundColor: app.d.bgcolor //页面标题为路由参数 // backgroundColor: app.d.bgcolor //页面标题为路由参数
}) // })
//页面初始化 options为页面跳转所带来的参数 //页面初始化 options为页面跳转所带来的参数
this.getMore(); this.getMore();
}, },

2
pages/new/new.json

@ -1,3 +1,3 @@
{ {
"navigationBarTitleText": "新品推荐" "usingComponents": {}
} }

53
pages/new/new.wxml

@ -25,7 +25,7 @@
</view> </view>
<!-- 加载页面结束 --> <!-- 加载页面结束 -->
<block wx:else> <block wx:else>
<view class='sort-wrap fd'> <!-- <view class='sort-wrap fd'>
<view class="sort-btn {{select == 0 ? 'select' : ''}}" bindtap="default"> <view class="sort-btn {{select == 0 ? 'select' : ''}}" bindtap="default">
最新 最新
</view> </view>
@ -40,46 +40,30 @@
<view class='sort-btn'> <view class='sort-btn'>
<view class='iconfont {{xianshi}}' bindtap="tabchage"> </view> <view class='iconfont {{xianshi}}' bindtap="tabchage"> </view>
</view> </view>
</view> </view> -->
<view class="list"> <view class="list">
<view class="cont" style='padding-top:10px;'> <view class="cont" style='padding-top:10px;'>
<view class="xs">
<view class="{{shu}}"> <navigator class="product xs" url="../product/detail?productId={{item.id}}&size={{item.size}}" hover-class="changestyle" wx:for="{{shopList}}" wx:key="index" data-id="{{item.id}}">
<navigator class="pr {{shu}}" url="../product/detail?productId={{item.id}}&size={{item.size}}" hover-class="changestyle" wx:for="{{shopList}}" wx:key="*this" data-id="{{item.id}}">
<!-- <view class='photo-c'>
<image class="photo" src="{{item.imgurl}}"></image> <image class="photo" src="{{item.imgurl}}"></image>
<image class="photo-right" wx:if="{{item.s_type==1}}" src="../../images/new.png"></image> <view class="title">新品 {{item.product_title}}</view>
</view> 不启用样式 右上角 --> <view class="gstatus">{{item.s_type_list[0].name}}</view>
<view class='photo-c'>
<image class="photo" src="{{item.imgurl}}"></image>
</view>
<view class='shu'>
<view class="title">
<text style="font-size:28rpx;width:30%;color:#B82136">新品 </text>
{{item.name}}</view>
<view style="display:flex;line-height:50rpx;;">
<view class="gmxx" style=" color: red;">¥ {{item.price_yh}}</view>
<view class="gmx">¥ {{item.price}}</view>
</view>
<view style="display:flex;line-height:50rpx;color:#999"> <view style="display:flex;line-height:50rpx;color:#999">
<view class="gmxx" style="font-size:28rpx;width:30%"> <view class="gmxx">¥ {{item.price}}</view>
<view class="ku">已售{{item.volume}}件</view>
<!-- <text wx:if="{{item.s_type==2}}">热销</text>
<text >推荐</text> -->
</view> </view>
<view class="ku" style="width:100%">销量:{{item.volume}}</view> <view style="display:flex;">
<view class="goods_shopBox">
<image class="goods_shop" src="{{logoUrl}}{{item.logo}}"></image>
<text>{{item.mch_name}}</text>
</view> </view>
<view class="discover" data-id="{{item.id}}" bindtap="discoverSimilarProducts">找相似</view>
</view> </view>
</navigator> </navigator>
</view> </view>
<view class="{{heng}}"> <!-- <view class="{{heng}}">
<navigator class="pr pr_xt" style='display:flex;margin-bottom:0px;width:100%;margin-left:0px;' url="../product/detail?productId={{item.id}}&size={{item.size}}" hover-class="changestyle" wx:for="{{shopList}}" wx:key="*this" data-id="{{item.id}}"> <navigator class="pr pr_xt" style='display:flex;margin-bottom:0px;width:100%;margin-left:0px;' url="../product/detail?productId={{item.id}}&size={{item.size}}" hover-class="changestyle" wx:for="{{shopList}}" wx:key="*this" data-id="{{item.id}}">
<!-- <view class='photo-c'>
<image class="photo" style='height:220rpx;width:230rpx;margin-left:3px;' src="{{item.imgurl}}"></image>
<image class="photo-right" wx:if="{{item.s_type==1}}" src="../../images/new.png"></image>
</view> 设置右上角图标样式 目前不启用 -->
<view class='photo-c'> <view class='photo-c'>
<image class="photo" style='height:220rpx;width:230rpx;margin-left:20rpx;padding-top:20rpx' src="{{item.imgurl}}"></image> <image class="photo" style='height:220rpx;width:230rpx;margin-left:20rpx;padding-top:20rpx' src="{{item.imgurl}}"></image>
</view> </view>
@ -94,18 +78,15 @@
<view class="gmx" style='text-align:right;'>¥ {{item.price}}</view> <view class="gmx" style='text-align:right;'>¥ {{item.price}}</view>
</view> </view>
<view style="display:flex;line-height:50rpx;color:#999"> <view style="display:flex;line-height:50rpx;color:#999">
<!--<view class="gmxx" style="font-size:28rpx;width:30%">
<text>新品</text>
</view> -->
<view class="ku">销量:{{item.volume}}</view> <view class="ku">销量:{{item.volume}}</view>
</view> </view>
</view> </view>
</navigator> </navigator>
</view> </view> -->
</view> </view>
<view class="commodity_screen" bindtap="hideModal" wx:if="{{showModalStatus}}">1</view> <view class="commodity_screen" bindtap="hideModal" wx:if="{{showModalStatus}}">1</view>
<view animation="{{animationData}}" class="commodity_attr_box" wx:if="{{showModalStatus}}"></view> <view animation="{{animationData}}" class="commodity_attr_box" wx:if="{{showModalStatus}}"></view>
<view class="clear mt10" wx:if="{{period}}" style='border:0;color#666' >-我是有底线的-</view> <view class="clear mt10" wx:if="{{period}}" style='border:0;color:#666'>-我是有底线的-</view>
<block wx:else> <block wx:else>
<!-- 显示加载 --> <!-- 显示加载 -->
<view style="display: flex;" wx:if="{{loading}}"> <view style="display: flex;" wx:if="{{loading}}">
@ -132,7 +113,7 @@
</view> </view>
<!-- <view class="clear mt10" wx:else bindtap="getMore">点击查看更多{{loading}}-</view> --> <!-- <view class="clear mt10" wx:else bindtap="getMore">点击查看更多{{loading}}-</view> -->
<view class='goTop' hidden='{{!floorstatus}}' bindtap="goTop"> <view class='goTop' hidden='{{!floorstatus}}' bindtap="goTop">
<image src='../../images/fanhui.png' style='width:20px;height:20px;margin:10px;'></image> <image src='/images/fanhui.png' style='width:20px;height:20px;margin:10px;'></image>
</view> </view>
</block> </block>
</view> </view>

103
pages/new/new.wxss

@ -100,7 +100,7 @@ page {
.list{ .list{
background: #eee; background: #eee;
width: 100%; width: 100%;
margin-top: 90rpx; /* margin-top: 90rpx; */
} }
.ban{ .ban{
width: 46%; width: 46%;
@ -125,8 +125,6 @@ page {
color: gray; color: gray;
} }
.commodity_screen { .commodity_screen {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -160,56 +158,71 @@ page {
font-size: 30rpx; font-size: 30rpx;
margin-top: 30rpx; margin-top: 30rpx;
} }
.cont .pr { .cont {
width: 100%;
margin: 0 auto;
}
.cont .product {
margin-bottom:10px; margin-bottom:10px;
background:#fff; background:#fff;
display:inline-block; display:inline-block;
width:46%; width:46%;
margin-left:20rpx; margin-left:22rpx;
font-size:13px;
border-radius: 10rpx;
overflow: hidden;
} }
.cont_image { .cont_image {
width: 100%; width: 100%;
height: 285rpx; height: 285rpx;
} }
.shu{
padding-left:10px;
padding-right:10px;
}
.cont .title { .cont .title {
font-size: 28rpx; font-size: 28rpx;
color: #333; color: #333;
line-height: 20px; line-height: 28px;
margin: 0; margin: 0;
height: 40px; max-height: 60rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
/* padding:0 0 0 10rpx; */
}
.cont .tit {
/*height: 80rpx;*/
font-size: 12px;
color: #333;
line-height: 20px;
margin: 0;
max-height: 40px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; padding: 0 20rpx 0 20rpx;
-webkit-line-clamp: 2; }
-webkit-box-orient: vertical;
padding: 1% 5% 0 5%; .cont .gstatus{
/*color: #ccc*/ color: #999;
font-size: 21rpx;
margin: 5rpx 20rpx 10rpx 20rpx;
/* border-radius: 40rpx; */
padding: 3rpx 5rpx;
height: 25rpx;
width: 45rpx;
line-height: 25rpx;
text-align: center;
border: 1rpx solid #999;
}
.discover{
display: flex;
align-items: center;
justify-content: center;
width:90rpx;
height:36rpx;
background:#FA9D3B;
border-radius:10rpx 0rpx 0rpx 0rpx;
margin-left: auto;
margin-top: auto;
font-size: 22rpx;
color: #ffffff;
} }
.photo{ .photo{
height:345rpx; height:345rpx;
width:345rpx; width:100%;
} }
.cont .photo { .cont .photo {
background:#fff; background:#fff;
display:inline-block; display:inline-block;
} }
@ -228,16 +241,17 @@ display:-webkit-box;
-webkit-box-orient:vertical; -webkit-box-orient:vertical;
} }
.gmxx { .gmxx {
/* padding-left:20rpx; */ padding-left:20rpx;
width:74%; width:74%;
} }
.gmx { .gmx {
text-align: right; text-align: right;
width:77%; width: 67%;
font-size:26rpx; font-size: 25rpx;
text-decoration:line-through; text-decoration:line-through;
color: #999; color: #999;
margin-right:7px;
} }
.gmx .xiaoliang { .gmx .xiaoliang {
font-size: 26rpx; font-size: 26rpx;
@ -253,14 +267,29 @@ display:-webkit-box;
font-family: '\5FAE\8F6F\96C5\9ED1', arial, "\5b8b\4f53"; font-family: '\5FAE\8F6F\96C5\9ED1', arial, "\5b8b\4f53";
} }
.gmxx{ .gmxx{
font-size: 14px; font-size: 15px;
color: #d9002f; color: #fa5151;
/*padding-top: 10px; */ /*padding-top: 10px; */
} }
.ku{ .ku{
text-align: right; text-align: right;
width: 100%; font-size: 26rpx; width: 50%;
color: #666; font-size: 23rpx;
margin-right:10rpx;
color: #999;
}
.goods_shopBox{
display: flex;
align-items: center;
margin: 15rpx 20rpx 15rpx;
font-size: 20rpx;
color: #1d1313;
}
.goods_shopBox .goods_shop{
width: 30rpx;
height: 30rpx;
border-radius: 50%;
margin-right: 10rpx;
} }
.icons { .icons {

19
pages/product/detail.js

@ -848,26 +848,7 @@ Page({
success(res) { success(res) {
if (!res.authSetting['scope.writePhotosAlbum']) { if (!res.authSetting['scope.writePhotosAlbum']) {
wx.authorize({
scope: 'scope.writePhotosAlbum',
success() {
console.log('授权成功')
},
fail: function (res) {
wx.openSetting({
success: (res) => {
res.authSetting = {
"scope.userInfo": true,
"scope.userLocation": true,
"scope.writePhotosAlbum": true
}
}
})
}
})
} else { } else {
} }

2
pages/product/detail.wxml

@ -83,7 +83,7 @@
<view style='clear:both;'></view> <view style='clear:both;'></view>
</view> </view>
<view class='kd_xl'> <view class='kd_xl'>
<text class="c6 font_14" style='color:#ccc;margin-right:90px;'>快递:{{itemData.freight}}</text> <text class="c6 font_14" style='color:#ccc;margin-right:90px;'>运费:{{itemData.freight}}</text>
<text class="c6 font_14" style='color:#ccc'>销量:{{itemData.volume}}</text> <text class="c6 font_14" style='color:#ccc'>销量:{{itemData.volume}}</text>
</view> </view>
</view> </view>

6
pages/set/set.js

@ -32,11 +32,7 @@ Page({
} else { } else {
wx.openSetting({ wx.openSetting({
success: (res) => { success: (res) => {
wx.authorize({
scope: 'scope.record',
success() {
}
})
} }
}) })
} }

14
utils/server.js

@ -62,10 +62,10 @@ module.exports = {
homeIndex: (data) => { //首页 homeIndex: (data) => { //首页
return requestServer('&action=index&app=index', 'post', data) return requestServer('&action=index&app=index', 'post', data)
}, },
newArrivalIndex: (data) => { //新品上市 newArrival: (data) => { //新品上市
return requestServer('&action=index&app=new_arrival', 'post', data) return requestServer('&action=index&app=new_arrival', 'post', data)
}, },
recommendIndex: (data) => { //好物优选 recommend: (data) => { //好物优选
return requestServer('&action=index&app=recommend', 'post', data) return requestServer('&action=index&app=recommend', 'post', data)
}, },
productIndex: (data) => { //商品详情 productIndex: (data) => { //商品详情
@ -99,10 +99,9 @@ module.exports = {
indexGetMore: (data) => { //更多 indexGetMore: (data) => { //更多
return requestServer('&action=index&app=get_more', 'post', data) return requestServer('&action=index&app=get_more', 'post', data)
}, },
newProduct: (data) => { //新品 // newProduct: (data) => { //新品
return requestServer('&action=product&m=new_product', 'post', data) // return requestServer('&action=product&m=new_product', 'post', data)
}, // },
productToCollection: (data) => { productToCollection: (data) => {
return requestServer('&action=product&m=to_Collection', 'post', data) return requestServer('&action=product&m=to_Collection', 'post', data)
}, },
@ -128,6 +127,9 @@ module.exports = {
getCountyInfo: (data) => { //根据省市获取县 getCountyInfo: (data) => { //根据省市获取县
return requestServer('&action=user&m=getCountyInfo', 'post', data) return requestServer('&action=user&m=getCountyInfo', 'post', data)
}, },
getLocation: (data) => { //获取地址信息
return requestServer('&action=index&app=get_location', 'post', data)
},
preservation: (data) => { preservation: (data) => {
return requestServer('&action=user&m=Preservation', 'post', data) return requestServer('&action=user&m=Preservation', 'post', data)
}, },

Loading…
Cancel
Save