作者 李洪娟

团购小程序

正在显示 100 个修改的文件 包含 2052 行增加0 行删除

要显示太多修改。

为保证性能只显示 100 of 100+ 个文件。

  1 +//app.js
  2 +App({
  3 + onLaunch: function () {
  4 + // 展示本地存储能力
  5 + var logs = wx.getStorageSync('logs') || []
  6 + logs.unshift(Date.now())
  7 + wx.setStorageSync('logs', logs)
  8 +
  9 + //自动更新版本
  10 + const updateManager = wx.getUpdateManager()
  11 + updateManager.onCheckForUpdate(function (res) {
  12 + // 请求完新版本信息的回调
  13 + })
  14 +
  15 + updateManager.onUpdateReady(function () {
  16 + wx.showModal({
  17 + title: '更新提示',
  18 + content: '新版本已经准备好,是否重启应用?',
  19 + success: function (res) {
  20 + if (res.confirm) {
  21 + // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
  22 + updateManager.applyUpdate()
  23 + }
  24 + }
  25 + })
  26 +
  27 + })
  28 +
  29 + updateManager.onUpdateFailed(function () {
  30 + // 新的版本下载失败
  31 + wx.showModal({
  32 + title: '更新提示',
  33 + content: '新版本下载失败',
  34 + showCancel: false
  35 + })
  36 + })
  37 + },
  38 + post: function (url, data, headerParams, showLoad) {
  39 + wx.showNavigationBarLoading()
  40 + var promise = new Promise((resolve, reject) => {
  41 + //init
  42 + let that = this;
  43 + let postData = data;
  44 + let baseUrl = 'http://grouppay.w.bronet.cn/api/';
  45 + //网络请求
  46 + let header = {
  47 + 'content-type': 'application/x-www-form-urlencoded'
  48 + }
  49 + header = Object.assign(header, headerParams)
  50 + //网络请求
  51 + wx.request({
  52 + url: baseUrl + url,
  53 + data: postData,
  54 + method: 'POST',
  55 + header: header,
  56 +
  57 + success: function (res) { //返回取得的数据
  58 + if (res.data.code == '20000') {
  59 + resolve(res.data);
  60 + } else if (res.data.code == '201') {
  61 + resolve(res.data);
  62 + }
  63 +
  64 + // else if (res.data.code == '10001') {
  65 + // wx.showToast({
  66 + // title: res.data.msg,
  67 + // icon: 'none',
  68 + // duration: 1000,
  69 + // success: function (res) {
  70 + // let t = setInterval(function () {
  71 + // clearInterval(t)
  72 + // wx.navigateTo({
  73 + // url: '/pages/index/index',
  74 + // })
  75 + // }, 1000)
  76 + // }
  77 + // })
  78 + // }
  79 +
  80 + else {
  81 + wx.showModal({
  82 + title: '提示',
  83 + content: res.data.msg,
  84 + showCancel: false
  85 + })
  86 + reject(res.data)
  87 + }
  88 + setTimeout(function () {
  89 + // if (show||show==undefined){
  90 + // wx.hideLoading()
  91 + // }
  92 + wx.hideNavigationBarLoading()
  93 + }, 600)
  94 + },
  95 + fail: function (e) {
  96 + reject('网络出错');
  97 + // wx.hideLoading()
  98 + wx.hideNavigationBarLoading()
  99 + }
  100 + })
  101 + });
  102 + return promise;
  103 + },
  104 + pay(res, successData) {
  105 + wx.requestPayment({
  106 + "timeStamp": res.pay.timeStamp,
  107 + "nonceStr": res.pay.nonceStr,
  108 + "package": res.pay.package,
  109 + "signType": "MD5",
  110 + "paySign": res.pay.paySign,
  111 + "success": function (res) {
  112 + wx.showToast({
  113 + title: '支付完成',
  114 + icon: "success",
  115 + duration: 1500,
  116 + success: function (data) {
  117 + successData(data)
  118 + }
  119 + })
  120 + },
  121 + "fail": function (res) {
  122 + wx.showToast({
  123 + title: '取消支付成功!',
  124 + icon: "icon",
  125 + duration: 1500,
  126 + })
  127 + }
  128 + })
  129 + },
  130 + nowDate() {
  131 + let date = new Date();
  132 + let month = date.getMonth() + 1;
  133 + let day = date.getDate();
  134 + return date.getFullYear() + '-' + (month > 9 ? month : ('0' + month)) + '-' + (day > 9 ? day : ('0' + day));
  135 + },
  136 + minDate() {
  137 + let date = new Date();
  138 + date.setDate(date.getDate() - 287);
  139 + let m = date.getMonth() + 1;
  140 + return date.getFullYear() + '-' + m + '-' + date.getDate();
  141 + },
  142 + timeFormate(timestamp, timeType) {
  143 + var timeStamp = timestamp.length == 13 ? timestamp : timestamp * 1000
  144 + var date = new Date(timeStamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  145 + var Y = date.getFullYear() + '-';
  146 + var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
  147 + var D = date.getDate() + ' ';
  148 + var h = date.getHours() + ':';
  149 + var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
  150 + var s = date.getSeconds();
  151 + if (timeType == 'YYMMDD') {
  152 + return Y + M + D;
  153 + } else {
  154 + return h + m;
  155 + }
  156 + },
  157 +
  158 + //接口管理
  159 + interface: {
  160 + historyDelete:'/home/index/historyDelete',//删除
  161 + shopClass:'/home/index/shopClass',//分类
  162 + shopPage:'/home/index/shopPage',//分页
  163 + history:'/home/index/history',//检索
  164 + index: '/home/index/index', //首页
  165 + login: '/wxapp/public/login', //小程序登录注册
  166 + getSessionKey: '/wxapp/public/getSessionKey', //获取sessionKey和openid
  167 + },
  168 + //全局变量
  169 + globalData: {
  170 + userInfo: null,
  171 + cid: null
  172 + }
  173 +})
  1 +{
  2 + "pages": [
  3 + "pages/homeindex/homeindex",
  4 + "pages/index/index",
  5 +
  6 +
  7 +
  8 +
  9 +
  10 +
  11 +
  12 + "pages/kind/kind",
  13 +
  14 + "pages/homeindex/result/result",
  15 + "pages/homeindex/search/search",
  16 +
  17 +
  18 + "pages/mine/mine",
  19 + "pages/kind/detail_1/detail_1",
  20 + "pages/kind/firm_order2/firm_order2",
  21 + "pages/kind/firm_order1/firm_order1",
  22 + "pages/kind/success/success",
  23 + "pages/mine/contactUs/contactUs",
  24 + "pages/mine/eOrder/eOrder",
  25 + "pages/mine/myOrder/myOrder",
  26 + "pages/mine/addr_2/addr_2",
  27 + "pages/mine/addr_1/addr_1",
  28 + "pages/logs/logs",
  29 + "pages/mine/collect/collect"
  30 +
  31 + ],
  32 + "window": {
  33 + "backgroundTextStyle": "light",
  34 + "navigationBarBackgroundColor": "#fff",
  35 + "navigationBarTitleText": "团购商城",
  36 + "navigationBarTextStyle": "black"
  37 + },
  38 + "tabBar": {
  39 + "selectedColor": "#6EAC3D",
  40 + "list": [
  41 + {
  42 + "pagePath": "pages/homeindex/homeindex",
  43 + "text": "首页",
  44 + "selectedColor": "#6EAC3D",
  45 + "iconPath": "img/01_nav@2x.png",
  46 + "selectedIconPath": "img/01_nav_fill@2x.png"
  47 + },
  48 + {
  49 + "pagePath": "pages/kind/kind",
  50 + "text": "分类",
  51 + "selectedColor": "#6EAC3D",
  52 + "iconPath": "img/02_nav@2x.png",
  53 + "selectedIconPath": "img/02_nav_fill@2x.png"
  54 + },
  55 + {
  56 + "pagePath": "pages/mine/mine",
  57 + "text": "我的",
  58 + "selectedColor": "#6EAC3D",
  59 + "iconPath": "img/03_nav@2x.png",
  60 + "selectedIconPath": "img/03_nav_fill@2x.png"
  61 + }
  62 + ]
  63 + }
  64 +}
  1 +/**app.wxss**/
  2 +/* .container {
  3 + height: 100%;
  4 + display: flex;
  5 + flex-direction: column;
  6 + align-items: center;
  7 + justify-content: space-between;
  8 + padding: 200rpx 0;
  9 + box-sizing: border-box;
  10 +} */

534 字节

631 字节

562 字节

  1 +// pages/homeindex/homeindex.js
  2 +const app = getApp()
  3 +Page({
  4 +
  5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + banner: [],
  10 + shop_class: [],
  11 + middle:'',
  12 + shop:[]
  13 + },
  14 + look_category(e) {
  15 + app.globalData.cid = e.currentTarget.dataset.index
  16 + wx.switchTab({
  17 + url: '/pages/kind/kind'
  18 + })
  19 + },
  20 + // 跳转页面
  21 + btn_name() {
  22 + wx.navigateTo({
  23 + url: '/pages/homeindex/search/search',
  24 + })
  25 + },
  26 + get_info() {
  27 + let that = this
  28 + let url = app.interface.index;
  29 + let header = {
  30 + 'XX-Device-Type': 'wxapp',
  31 + 'XX-Token': wx.getStorageSync('token')
  32 + }
  33 +
  34 + app.post(url, {}, header).then((res) => {
  35 + console.log(res)
  36 + that.setData({
  37 + banner: res.data.banner,
  38 + shop_class: res.data.shop_class,
  39 + middle: res.data.middle,
  40 + shop:res.data.shop
  41 + })
  42 +
  43 + }).catch((errMsg) => {})
  44 +
  45 + },
  46 + /**
  47 + * 生命周期函数--监听页面加载
  48 + */
  49 + onLoad: function(options) {
  50 + let that = this
  51 + that.get_info()
  52 + },
  53 +
  54 + /**
  55 + * 生命周期函数--监听页面初次渲染完成
  56 + */
  57 + onReady: function() {
  58 +
  59 + },
  60 +
  61 + /**
  62 + * 生命周期函数--监听页面显示
  63 + */
  64 + onShow: function() {
  65 +
  66 + },
  67 +
  68 + /**
  69 + * 生命周期函数--监听页面隐藏
  70 + */
  71 + onHide: function() {
  72 +
  73 + },
  74 +
  75 + /**
  76 + * 生命周期函数--监听页面卸载
  77 + */
  78 + onUnload: function() {
  79 +
  80 + },
  81 +
  82 + /**
  83 + * 页面相关事件处理函数--监听用户下拉动作
  84 + */
  85 + onPullDownRefresh: function() {
  86 +
  87 + },
  88 +
  89 + /**
  90 + * 页面上拉触底事件的处理函数
  91 + */
  92 + onReachBottom: function() {
  93 +
  94 + },
  95 +
  96 + /**
  97 + * 用户点击右上角分享
  98 + */
  99 + onShareAppMessage: function() {
  100 +
  101 + }
  102 +})
  1 +{
  2 + "navigationBarTitleText": "首页",
  3 + "navigationBarBackgroundColor": "#6EAC3D",
  4 + "navigationBarTextStyle": "white"
  5 +}
  1 +<!--pages/homeindex/homeindex.wxml-->
  2 +<!-- <text>pages/homeindex/homeindex.wxml</text> -->
  3 +
  4 +<view class='search'>
  5 + <view class='search_inp' bindtap="btn_name">
  6 + <!-- <input type='text' bindtap="btn_name" placeholder='请输入商品名称'></input> -->
  7 + 请输入商品名称
  8 + <image src='../../img/search.png'></image>
  9 + </view>
  10 + <view class='search_txt' bindtap="btn_name">
  11 + 搜索
  12 + </view>
  13 +</view>
  14 +<view class='banner'>
  15 + <swiper indicator-dots="true" indicator-active-color="#fff" style="width:100%;height:100%;">
  16 + <swiper-item wx:for='{{banner}}' wx:key="index">
  17 + <image style="width: 688rpx;" mode='widthFix' src='{{item.img}}' />
  18 + </swiper-item>
  19 + </swiper>
  20 + <view class='banner_Mask'></view>
  21 +</view>
  22 +<view class='commodity'>
  23 + <!-- <navigator url=''>
  24 + </navigator> -->
  25 + <view class='jujia' wx:for='{{shop_class}}' wx:key="index" bindtap='look_category' data-index='{{index}}'>
  26 + <image src='{{item.img}}'></image>
  27 + <text>{{item.class_name}}</text>
  28 + </view>
  29 + <view class='fenlei' bindtap='look_category'>
  30 + <image src='../../img/fenlei@3x.png'></image>
  31 + <text>全部分类</text>
  32 + </view>
  33 +</view>
  34 +<view class='introduce'>
  35 + <view class='introduce_list'>
  36 + <view class='introduce_item'>
  37 + <image src='../../img/anquan@3x.png'></image>
  38 + <text>安心检测</text>
  39 + </view>
  40 + <view class='introduce_item'>
  41 + <image src='../../img/youxuan@3x.png'></image>
  42 + <text>优选源头</text>
  43 + </view>
  44 + <view class='introduce_item'>
  45 + <image src='../../img/baozhang@3x.png'></image>
  46 + <text>赔付保障</text>
  47 + </view>
  48 + </view>
  49 + <image src='{{middle}}'></image>
  50 +</view>
  51 +<view class='container'>
  52 + <view class='mid'>
  53 + <view class='ware_box' wx:for='{{shop}}' wx:key="index">
  54 + <view class='ware_top'>
  55 + <view class='ware_1'>
  56 + <image src='{{item.thumb}}'></image>
  57 + <view class='ware_1_time'>
  58 + 据结束2时22分
  59 + </view>
  60 + </view>
  61 + <view class='ware_text'>
  62 + <view class='ware_2'>
  63 + <text class='ware_2Txt1'>{{item.name}}</text>
  64 + <text class='ware_2Txt2'>{{item.origin}}</text>
  65 + </view>
  66 + <view class='ware_3'>
  67 + <progress percent="42" show-info color="#B5DE96" border-radius="8" font-size="24rpx" stroke-width="16rpx" />
  68 + </view>
  69 + <view class='ware_4'>
  70 + <text>现有{{item.numb}}份,目标{{item.group}}份</text>
  71 + </view>
  72 + <view class='ware_5'>
  73 + <view>
  74 + <text class='ware5_t1'>{{item.money_sale}}</text>
  75 + <text class='ware5_t2'>{{item.shop_type}}</text>
  76 + </view>
  77 + <view class='ware5_box'>
  78 + <view class='ware5_t3'>{{item.text_table}}</view>
  79 + <view class='ware5_t4'>{{item.text_content}}</view>
  80 + </view>
  81 + <view class='ware_6'>
  82 + <view>立即参团</view>
  83 + </view>
  84 + </view>
  85 + </view>
  86 + </view>
  87 + <view class='ware_bot'>
  88 + <view class='ware_bot_tit'>经典推荐</view>
  89 + <view class='ware_bot_txt'>{{item.recommend}}</view>
  90 + </view>
  91 + </view>
  92 + </view>
  93 +</view>
  1 +/* pages/homeindex/homeindex.wxss */
  2 +.search{
  3 + padding: 16rpx 32rpx;
  4 + height: 64rpx;
  5 + background: #6EAC3D;
  6 + display: flex;
  7 + justify-content: center;
  8 + align-content: space-between;
  9 +}
  10 +.search_inp{
  11 + box-sizing: border-box;
  12 + width: 608rpx;
  13 + height: 64rpx;
  14 + border-radius: 32rpx;
  15 + display:flex;
  16 + align-items: center;
  17 + padding-left: 76rpx;
  18 + padding-right: 32rpx;
  19 + background:#fff;
  20 + border: 0;
  21 + outline: none;
  22 + font-size: 26rpx;
  23 + position: relative;
  24 +}
  25 +.search_inp input{
  26 + width: 100%;
  27 +}
  28 +.search_inp image{
  29 + position: absolute;
  30 + left: 32rpx;
  31 + top: 17rpx;
  32 + width: 32rpx;
  33 + height: 32rpx;
  34 +}
  35 +.search_txt{
  36 + height: 64rpx;
  37 + font-size: 30rpx;
  38 + color: #fff;
  39 + line-height: 64rpx;
  40 + padding-left: 16rpx;
  41 +}
  42 +.banner{
  43 + width: 688rpx;
  44 + height: 336rpx;
  45 + margin: 0 auto;
  46 + margin-top: 48rpx;
  47 + position: relative;
  48 + border-radius: 8rpx;
  49 +}
  50 +.swiper{
  51 + height: 100%;
  52 + position: absolute;
  53 + z-index: 99;
  54 +}
  55 +.swiper-item{
  56 + width: 688rpx;
  57 + margin: 0 auto;
  58 + height: 336rpx;
  59 + border-radius: 8rpx;
  60 +}
  61 +.swiper-item image{
  62 + height: auto;
  63 +}
  64 +.banner_Mask{
  65 + width:656rpx;
  66 + height: 336rpx;
  67 + background:rgba(181,222,150,1);
  68 + box-shadow:0rpx 6rpx 40rpx rgba(93,255,0,0.44);
  69 + opacity:0.3;
  70 + position: absolute;
  71 + bottom: 16rpx;
  72 + z-index: -1;
  73 + left: 16rpx;
  74 + border-radius: 8rpx;
  75 +}
  76 +.commodity{
  77 + width: 688rpx;
  78 + /* margin: 0 auto; */
  79 + padding: 64rpx 32rpx;
  80 + display: flex;
  81 + justify-content:space-around;
  82 + align-items: center;
  83 + font-size: 24rpx;
  84 + color: #333333;
  85 + border-bottom: 8px solid rgba(249,250,252,1);
  86 +}
  87 +.commodity view{
  88 +}
  89 +.introduce_list {
  90 + display: flex;
  91 + justify-content: space-around;
  92 + align-items: center;
  93 + padding: 36rpx 32rpx 48rpx 32rpx;
  94 +}
  95 +.introduce_list .introduce_item{
  96 + display: flex;
  97 + justify-content: space-between;
  98 + align-items: center;
  99 +}
  100 +.introduce_list .introduce_item:first-child image{
  101 + width: 32rpx;
  102 + height: 36rpx;
  103 +}
  104 +.introduce_list .introduce_item:nth-child(2) image{
  105 + width: 36rpx;
  106 + height: 31rpx;
  107 +}
  108 +.introduce_list .introduce_item:nth-child(3) image{
  109 + width: 32rpx;
  110 + height: 29rpx;
  111 +}
  112 +.introduce_list .introduce_item text{
  113 + font-size: 28rpx;
  114 + display: flex;
  115 + align-items: center;
  116 + margin-left: 16rpx;
  117 +}
  118 +.introduce image{
  119 + width: 668rpx;
  120 + height: 208rpx;
  121 + display: block;
  122 + margin: 0 auto;
  123 +}
  124 +.commodity .jujia image,.commodity .fenlei image{
  125 + width: 112rpx;
  126 + height: 112rpx;
  127 + margin: 0 auto;
  128 +}
  129 +.commodity text{
  130 + display: flex;
  131 + margin-top: 14rpx;
  132 + text-align: center;
  133 + justify-content: center;
  134 + align-items: center;
  135 +}
  136 +
  137 +.container{
  138 + width: 750rpx;
  139 + display: flex;
  140 + align-items: center;
  141 + flex-flow: column;
  142 +}
  143 +.mid{
  144 + margin-top: 16rpx;
  145 + display: flex;
  146 + flex-flow: column;
  147 +}
  148 +.ware_box{
  149 + width:688rpx;
  150 + height:400rpx;
  151 + margin:32rpx auto;
  152 + background:#F9FAFC;
  153 +}
  154 +.ware_top{
  155 + overflow: hidden;
  156 + display: flex;
  157 + padding:32rpx 18rpx 0;
  158 +}
  159 +.ware_1{
  160 + width:312rpx;
  161 + height:208rpx;
  162 + position: relative;
  163 +}
  164 +.ware_1 image{
  165 + width:100%;
  166 + height:100%;
  167 +}
  168 +.ware_1_time{
  169 + position: absolute;
  170 + bottom:0;
  171 + width:208rpx;
  172 + height:48rpx;
  173 + color: white;
  174 + text-align: center;
  175 + line-height:48rpx;
  176 + font-size:24rpx;
  177 + background:#FAC8C8;
  178 + font-family:PingFang SC;
  179 +}
  180 +.ware_text{
  181 + margin-left:14rpx;
  182 + width:100%;
  183 +}
  184 +.ware_2{
  185 + display: flex;
  186 + justify-content: space-between;
  187 + align-content: center;
  188 +}
  189 +.ware_2Txt1{
  190 + font-size:32rpx;
  191 + font-family:PingFang SC;
  192 + font-weight:600;
  193 + line-height:44rpx;
  194 + color:rgba(51,51,51,1);
  195 +}
  196 +.ware_2Txt2{
  197 + font-size:22rpx;
  198 + /* margin-left:98rpx; */
  199 + font-family:PingFang SC;
  200 + font-weight:400;
  201 + line-height:32rpx;
  202 + color:rgba(204,204,204,1);
  203 +}
  204 +.ware_3 progress{
  205 + width:370rpx;
  206 + color:#B5DE96;
  207 + margin-top:24rpx;
  208 +}
  209 +.ware_4 text,.ware5_t2{
  210 + font-size:18rpx;
  211 + font-family:PingFang SC;
  212 + font-weight:400;
  213 + line-height:32rpx;
  214 + color:rgba(204,204,204,1);
  215 +}
  216 +.ware_5{
  217 + display: flex;
  218 + display: -webkit-flex;
  219 + justify-content: space-between;
  220 +}
  221 +.ware5_t1{
  222 + font-size:30rpx;
  223 + font-family:DIN 1451 Std Mittelschrift;
  224 + font-weight:400;
  225 + color:rgba(255,0,0,1);
  226 +}
  227 +.ware5_t3{
  228 + font-size:22rpx;
  229 + font-family:PingFang SC;
  230 + font-weight:400;
  231 + line-height:30rpx;
  232 + color:rgba(51,51,51,1);
  233 +}
  234 +.ware5_t4{
  235 + font-size:18rpx;
  236 + font-family:PingFang SC;
  237 + font-weight:400;
  238 + color:rgba(153,153,153,1);
  239 +}
  240 +.ware_6{
  241 + width:144rpx;
  242 + height:48rpx;
  243 + background:rgba(249,150,20,1);
  244 + box-shadow:0px 2rpx 12rpx rgba(255,145,0,0.16);
  245 + border-radius:24rpx;
  246 +}
  247 +.ware_6 view{
  248 + font-size:26rpx;
  249 + font-family:PingFang SC;
  250 + font-weight:400;
  251 + text-align: center;
  252 + line-height:48rpx;
  253 + color:rgba(255,255,255,1);
  254 +}
  255 +.ware_bot{
  256 + width:670rpx;
  257 + height:80rpx;
  258 + margin: auto;
  259 + display: flex;
  260 + line-height:80rpx;
  261 + margin-top:32rpx;
  262 + background-color:#F1F7F1;
  263 +}
  264 +.ware_bot_tit{
  265 + font-size:30rpx;
  266 + font-weight:bold;
  267 + margin-left:32rpx;
  268 + color:rgba(110,172,61,1);
  269 +}
  270 +.ware_bot_tit:after{
  271 + content:"";
  272 + margin:0 38rpx;
  273 + border-right:1px solid #B5DE96;
  274 +}
  275 +.ware_bot_txt{
  276 + font-size:24rpx;
  277 + font-family:PingFang SC;
  278 + font-weight:400;
  279 + color:rgba(153,153,153,1);
  280 +}
  281 +/* 规格 */
  282 +.spec{
  283 + width:100%;
  284 + padding:0 32rpx;
  285 + line-height:80rpx;
  286 + display: flex;
  287 + height:80rpx;
  288 + margin-top:8rpx;
  289 + background:white;
  290 +}
  291 +.spec_txt{
  292 + font-size:32rpx;
  293 + font-family:PingFang SC;
  294 + font-weight:400;
  295 + color:rgba(51,51,51,1);
  296 +}
  297 +.spec_txt2{
  298 + font-size:24rpx;
  299 + font-family:PingFang SC;
  300 + font-weight:400;
  301 + margin-left:108rpx;
  302 + color:rgba(153,153,153,1);
  303 +}
  304 +/* 商品详情 */
  305 +.ware_detail{
  306 + width:100%;
  307 + margin-top:8rpx;
  308 + margin-bottom:96rpx;
  309 + padding-bottom:66rpx;
  310 + background: white;
  311 +}
  312 +.ware_detail_tit{
  313 + width:688rpx;
  314 + margin: auto;
  315 + display: flex;
  316 + padding:44rpx 0rpx 42rpx;
  317 + justify-content:space-around;
  318 + border-bottom:2rpx solid #F5F5F5;
  319 +}
  320 +.ware_detail .ware_active{
  321 + color:#6EAC3D;
  322 + font-weight:600;
  323 +}
  324 +.ware_active:after{
  325 + content: "";
  326 + width:16rpx;
  327 + height: 6rpx;
  328 + margin: auto;
  329 + display: block;
  330 + margin-top:6rpx;
  331 + border-radius:8rpx;
  332 + background:rgba(110,172,61,1);
  333 +}
  334 +.ware_detail_tit view{
  335 + font-size:28rpx;
  336 + font-family:PingFang SC;
  337 + font-weight:400;
  338 + color:rgba(153,153,153,1);
  339 +}
  340 +.ware_detailC{
  341 + width:688rpx;
  342 + margin:26rpx auto 0;
  343 +}
  344 +
  345 +.ware_detailImg{
  346 + width:688rpx;
  347 + height:470rpx;
  348 +}
  349 +.ware_detailImg image{
  350 + width:100%;
  351 + height:100%;
  352 +}
  1 +// pages/homeindex/result/result.js
  2 +Page({
  3 +
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 +
  9 + },
  10 +
  11 + /**
  12 + * 生命周期函数--监听页面加载
  13 + */
  14 + onLoad: function (options) {
  15 +
  16 + },
  17 +
  18 + /**
  19 + * 生命周期函数--监听页面初次渲染完成
  20 + */
  21 + onReady: function () {
  22 +
  23 + },
  24 +
  25 + /**
  26 + * 生命周期函数--监听页面显示
  27 + */
  28 + onShow: function () {
  29 +
  30 + },
  31 +
  32 + /**
  33 + * 生命周期函数--监听页面隐藏
  34 + */
  35 + onHide: function () {
  36 +
  37 + },
  38 +
  39 + /**
  40 + * 生命周期函数--监听页面卸载
  41 + */
  42 + onUnload: function () {
  43 +
  44 + },
  45 +
  46 + /**
  47 + * 页面相关事件处理函数--监听用户下拉动作
  48 + */
  49 + onPullDownRefresh: function () {
  50 +
  51 + },
  52 +
  53 + /**
  54 + * 页面上拉触底事件的处理函数
  55 + */
  56 + onReachBottom: function () {
  57 +
  58 + },
  59 +
  60 + /**
  61 + * 用户点击右上角分享
  62 + */
  63 + onShareAppMessage: function () {
  64 +
  65 + }
  66 +})
  1 +{
  2 + "navigationBarTitleText": "",
  3 + "navigationBarBackgroundColor": "#6EAC3D",
  4 + "navigationBarTextStyle": "white"
  5 +}
  1 +<!--pages/homeindex/result/result.wxml-->
  2 +<!-- <text>pages/homeindex/result/result.wxml</text> -->
  3 +<view class='search'>
  4 + <view class='search_inp'>
  5 + <input type='text' placeholder='请输入商品名称'></input>
  6 + <image src='../../../img/search.png'></image>
  7 + </view>
  8 + <view class='search_txt'>
  9 + 取消
  10 + </view>
  11 +</view>
  12 +
  13 +<view class='container'>
  14 + <view class='mid'>
  15 + <view class='mid_item'>
  16 + <!-- 顶部 -->
  17 + <view class='mid_item_top'>
  18 + <!-- 左边 -->
  19 + <view class='mid_item_top_left'>
  20 + <view class='top_left_pic'>
  21 + <image src='../../../img/goods_1.png'></image>
  22 + </view>
  23 + <view class='top_left_text'>
  24 + 距结束23时59分距结束23时59分
  25 + </view>
  26 + </view>
  27 + <!-- 右边 -->
  28 + <view class='mid_item_top_right'>
  29 + <!-- 右上 -->
  30 + <view class='right_top'>
  31 + <view class='right_top_lef'>
  32 + 纯进口有机菜花
  33 + </view>
  34 + <view class='right_top_rig'>
  35 + 产地:智利
  36 + </view>
  37 + </view>
  38 + <!-- 右中1 -->
  39 + <view class='right_mid'>
  40 + <view class='right_mid_lef'>
  41 + <view class='right_mid_lef_color'></view>
  42 + </view>
  43 + <view class='right_mid_rig'>
  44 + 42%
  45 + </view>
  46 + </view>
  47 + <!-- 右中2 -->
  48 + <view class='right_text'>
  49 + 已拼300份,目标500份
  50 + </view>
  51 + <!-- 右下 -->
  52 + <view class='right_bottom'>
  53 + <!-- 右下左 -->
  54 + <view class='right_bottom_lef'>
  55 + <span class='RBM'>¥</span>
  56 + <span class='number'>52/</span>
  57 + <span class='text'>1磅1份1磅1份</span>
  58 + </view>
  59 + <!-- 右下中 -->
  60 + <view class='right_bottom_mid'>
  61 + <view class='right_bottom_mid_t'>
  62 + 40mm-50m
  63 + </view>
  64 + <view class='right_bottom_mid_b'>
  65 + 番茄果径番茄果径番茄果径
  66 + </view>
  67 + </view>
  68 + <!-- 右下右 -->
  69 + <view class='right_bottom_rig'>
  70 + 立即参团
  71 + </view>
  72 + </view>
  73 + </view>
  74 +
  75 +
  76 + </view>
  77 + <view class='mid_item_bottom'>
  78 + <view class='mid_item_bottom_left'>
  79 + 经典推荐
  80 + </view>
  81 + <!-- 竖线 -->
  82 + <view class='mid_line'></view>
  83 + <!-- 底部文本 -->
  84 + <view class='mid_item_bottom_bot'>
  85 + 智利进口,绿色健康,硕大饱满
  86 + </view>
  87 + </view>
  88 + </view>
  89 + <view class='mid_item'>
  90 + <!-- 顶部 -->
  91 + <view class='mid_item_top'>
  92 + <!-- 左边 -->
  93 + <view class='mid_item_top_left'>
  94 + <view class='top_left_pic'>
  95 + <image src='../../../img/goods_1.png'></image>
  96 + </view>
  97 + <view class='top_left_text'>
  98 + 距结束23时59分距结束23时59分
  99 + </view>
  100 + </view>
  101 + <!-- 右边 -->
  102 + <view class='mid_item_top_right'>
  103 + <!-- 右上 -->
  104 + <view class='right_top'>
  105 + <view class='right_top_lef'>
  106 + 纯进口有机菜花
  107 + </view>
  108 + <view class='right_top_rig'>
  109 + 产地:智利
  110 + </view>
  111 + </view>
  112 + <!-- 右中1 -->
  113 + <view class='right_mid'>
  114 + <view class='right_mid_lef'>
  115 + <view class='right_mid_lef_color'></view>
  116 + </view>
  117 + <view class='right_mid_rig'>
  118 + 42%
  119 + </view>
  120 + </view>
  121 + <!-- 右中2 -->
  122 + <view class='right_text'>
  123 + 已拼300份,目标500份
  124 + </view>
  125 + <!-- 右下 -->
  126 + <view class='right_bottom'>
  127 + <!-- 右下左 -->
  128 + <view class='right_bottom_lef'>
  129 + <span class='RBM'>¥</span>
  130 + <span class='number'>52/</span>
  131 + <span class='text'>1磅1份1磅1份</span>
  132 + </view>
  133 + <!-- 右下中 -->
  134 + <view class='right_bottom_mid'>
  135 + <view class='right_bottom_mid_t'>
  136 + 40mm-50m
  137 + </view>
  138 + <view class='right_bottom_mid_b'>
  139 + 番茄果径番茄果径番茄果径
  140 + </view>
  141 + </view>
  142 + <!-- 右下右 -->
  143 + <view class='right_bottom_rig'>
  144 + 立即参团
  145 + </view>
  146 + </view>
  147 + </view>
  148 +
  149 +
  150 + </view>
  151 + <view class='mid_item_bottom'>
  152 + <view class='mid_item_bottom_left'>
  153 + 经典推荐
  154 + </view>
  155 + <!-- 竖线 -->
  156 + <view class='mid_line'></view>
  157 + <!-- 底部文本 -->
  158 + <view class='mid_item_bottom_bot'>
  159 + 智利进口,绿色健康,硕大饱满
  160 + </view>
  161 + </view>
  162 + </view>
  163 + <view class='mid_item'>
  164 + <!-- 顶部 -->
  165 + <view class='mid_item_top'>
  166 + <!-- 左边 -->
  167 + <view class='mid_item_top_left'>
  168 + <view class='top_left_pic'>
  169 + <image src='../../../img/goods_1.png'></image>
  170 + </view>
  171 + <view class='text_color'>
  172 + 距结束2时22分距结束2时22分
  173 + </view>
  174 + </view>
  175 + <!-- 右边 -->
  176 + <view class='mid_item_top_right'>
  177 + <!-- 右上 -->
  178 + <view class='right_top'>
  179 + <view class='right_top_lef'>
  180 + 纯进口有机菜花
  181 + </view>
  182 + <view class='right_top_rig'>
  183 + 产地:罗利
  184 + </view>
  185 + </view>
  186 + <!-- 右中1 -->
  187 + <view class='right_mid'>
  188 + <view class='right_mid_lef'>
  189 + <view class='right_mid_lef_color'></view>
  190 + </view>
  191 + <view class='right_mid_rig'>
  192 + 42%
  193 + </view>
  194 + </view>
  195 + <!-- 右中2 -->
  196 + <view class='right_text'>
  197 + 已拼300份,目标500份
  198 + </view>
  199 + <!-- 右下 -->
  200 + <view class='right_bottom'>
  201 + <!-- 右下左 -->
  202 + <view class='right_bottom_lef'>
  203 + <span class='RBM'>¥</span>
  204 + <span class='number'>52/</span>
  205 + <span class='text'>1磅1份1磅1份</span>
  206 +
  207 + </view>
  208 + <!-- 右下中 -->
  209 + <view class='right_bottom_mid'>
  210 + <view class='right_bottom_mid_t'>
  211 + 40mm-50m
  212 + </view>
  213 + <view class='right_bottom_mid_b'>
  214 + 番茄果径 番茄果径番茄果径
  215 + </view>
  216 + </view>
  217 + <!-- 右下右 -->
  218 + <view class='right_bottom_rig'>
  219 + 立即参团
  220 + </view>
  221 + </view>
  222 + </view>
  223 +
  224 +
  225 + </view>
  226 + <view class='mid_item_bottom'>
  227 + <view class='mid_item_bottom_left'>
  228 + 经典推荐
  229 + </view>
  230 + <!-- 竖线 -->
  231 + <view class='mid_line'></view>
  232 + <!-- 底部文本 -->
  233 + <view class='mid_item_bottom_bot'>
  234 + 智利进口,绿色健康,硕大饱满
  235 + </view>
  236 + </view>
  237 + </view>
  238 + </view>
  239 +</view>
  1 +/* pages/homeindex/result/result.wxss */
  2 +.search{
  3 + padding: 16rpx 32rpx;
  4 + height: 64rpx;
  5 + background: #6EAC3D;
  6 + display: flex;
  7 + justify-content: center;
  8 + align-content: space-between;
  9 +}
  10 +.search_inp{
  11 + box-sizing: border-box;
  12 + width: 608rpx;
  13 + height: 64rpx;
  14 + border-radius: 32rpx;
  15 + display:flex;
  16 + align-items: center;
  17 + padding-left: 76rpx;
  18 + padding-right: 32rpx;
  19 + background:#fff;
  20 + border: 0;
  21 + outline: none;
  22 + font-size: 26rpx;
  23 + position: relative;
  24 +}
  25 +.search_inp input{
  26 + width: 100%;
  27 +}
  28 +.search_inp image{
  29 + position: absolute;
  30 + left: 32rpx;
  31 + width: 32rpx;
  32 + height: 32rpx;
  33 +}
  34 +.search_txt{
  35 + height: 64rpx;
  36 + font-size: 30rpx;
  37 + color: #fff;
  38 + line-height: 64rpx;
  39 + padding-left: 16rpx;
  40 +}
  41 +.container{
  42 + width: 750rpx;
  43 + display: flex;
  44 + align-items: center;
  45 + flex-flow: column;
  46 +}
  47 +.mid{
  48 + margin-top: 16rpx;
  49 + display: flex;
  50 + flex-flow: column;
  51 +}
  52 +.mid_item{
  53 + margin-top: 16rpx;
  54 + width:688rpx;
  55 + /* height:400rpx; */
  56 + background:rgba(249,250,252,1);
  57 + opacity:1;
  58 + border-radius:8rpx;
  59 + display: flex;
  60 + align-items: center;
  61 + flex-flow: column;
  62 + box-sizing: border-box;
  63 + padding: 52rpx 16rpx 48rpx;
  64 +}
  65 +.mid_item_top{
  66 + display: flex;
  67 + width: 100%;
  68 +}
  69 +.mid_item_top_left{
  70 + width:208rpx;
  71 + height:208rpx;
  72 + /* background:rgba(250,250,250,1); */
  73 + opacity:1;
  74 + display: flex;
  75 + flex-flow: column;
  76 +}
  77 +.top_left_pic{
  78 + width: 208rpx;
  79 + height: 160rpx;
  80 + display: flex;
  81 +}
  82 +.top_left_pic image{
  83 + width: 100%;
  84 + height: 100%;
  85 +}
  86 +.top_left_text{
  87 + width: 202rpx;
  88 + height:48rpx;
  89 + background:rgba(251,4,4,1);
  90 + opacity:0.2;
  91 + text-align: center;
  92 + font-size:24rpx;
  93 + font-family:PingFang SC;
  94 + font-weight:400;
  95 + line-height:48rpx;
  96 + color:rgba(255,255,255,1);
  97 +
  98 + overflow: hidden;
  99 + text-overflow: ellipsis;
  100 + white-space: nowrap;
  101 +}
  102 +.mid_item_top_right{
  103 + width: 100%;
  104 + margin-left: 14rpx;
  105 +}
  106 +.right_top{
  107 + display: flex;
  108 + align-items: center;
  109 + justify-content: space-between;
  110 + margin-top: 20rpx;
  111 +}
  112 +.right_top_lef{
  113 + width: 270rpx;
  114 + font-size:32rpx;
  115 + font-family:PingFang SC;
  116 + font-weight:600;
  117 + color:rgba(51,51,51,1);
  118 + opacity:1;
  119 + overflow: hidden;
  120 + text-overflow: ellipsis;
  121 + white-space: nowrap;
  122 +}
  123 +.right_top_rig{
  124 + font-size:22rpx;
  125 + font-family:PingFang SC;
  126 + font-weight:400;
  127 + line-height:32rpx;
  128 + color:rgba(204,204,204,1);
  129 + opacity:1;
  130 +}
  131 +.right_mid{
  132 + margin-top: 16rpx;
  133 + display: flex;
  134 + align-items: center;
  135 +}
  136 +.right_mid_lef{
  137 + width:288rpx;
  138 + height:16rpx;
  139 + background:rgba(236,236,236,1);
  140 + opacity:1;
  141 + border-radius:8rpx;
  142 +}
  143 +.right_mid_lef_color{
  144 + width:206rpx;
  145 + height:16rpx;
  146 + background:rgba(181,222,150,1);
  147 + opacity:1;
  148 + border-radius:8rpx;
  149 +}
  150 +.right_mid_rig{
  151 + margin-left: 16rpx;
  152 + font-size:24rpx;
  153 + font-family:PingFang SC;
  154 + font-weight:400;
  155 + line-height:34rpx;
  156 + color:rgba(181,222,150,1);
  157 + opacity:1;
  158 +}
  159 +.right_text{
  160 + margin-top: 14rpx;
  161 + font-size:22rpx;
  162 + font-family:PingFang SC;
  163 + font-weight:400;
  164 + color:rgba(204,204,204,1);
  165 + opacity:1;
  166 +}
  167 +.right_bottom{
  168 + display: flex;
  169 + align-items: center;
  170 + justify-content: space-between;
  171 +}
  172 +.RBM{
  173 + font-size: 22rpx;
  174 + color: #ff0000;
  175 +}
  176 +.number{
  177 + font-size: 30rpx;
  178 + color: #ff0000;
  179 +}
  180 +.text{
  181 +
  182 + font-size:22rpx;
  183 + font-family:PingFang SC;
  184 + font-weight:400;
  185 + line-height:32rpx;
  186 + color:rgba(204,204,204,1);
  187 + opacity:1;
  188 +}
  189 +.right_bottom_mid{
  190 + width: 122rpx;
  191 +}
  192 +.right_bottom_mid_t{
  193 +
  194 + font-size:22rpx;
  195 + font-family:PingFang SC;
  196 + font-weight:400;
  197 + color:rgba(51,51,51,1);
  198 + opacity:1;
  199 +
  200 + overflow: hidden;
  201 + text-overflow: ellipsis;
  202 + white-space: nowrap;
  203 +
  204 +}
  205 +.right_bottom_mid_b{
  206 + font-size:18rpx;
  207 + font-family:PingFang SC;
  208 + font-weight:400;
  209 + color:rgba(153,153,153,1);
  210 + opacity:1;
  211 +
  212 + overflow: hidden;
  213 + text-overflow: ellipsis;
  214 + white-space: nowrap;
  215 +}
  216 +.right_bottom_rig{
  217 + width:144rpx;
  218 + height:48rpx;
  219 + line-height: 48rpx;
  220 + background:rgba(249,150,20,1);
  221 + box-shadow:0rpx 2rpx 12rpx rgba(255,145,0,0.16);
  222 + opacity:1;
  223 + border-radius:24rpx;
  224 +
  225 + text-align: center;
  226 + font-size:26rpx;
  227 + font-family:PingFang SC;
  228 + font-weight:400;
  229 + color:rgba(255,255,255,1);
  230 +}
  231 +.mid_item_bottom{
  232 + margin-top: 32rpx;
  233 + width:640rpx;
  234 + height:80rpx;
  235 + background:rgba(181,222,150,0.1);
  236 + border-radius:16rpx;
  237 + display: flex;
  238 + align-items: center;
  239 + box-sizing: border-box;
  240 + padding: 0 32rpx;
  241 +}
  242 +.mid_item_bottom_left{
  243 + font-size:30rpx;
  244 + font-family:汉真广标;
  245 + font-weight:400;
  246 + color:rgba(110,172,61,1);
  247 + opacity:1;
  248 +
  249 +}
  250 +.mid_line{
  251 + margin: 0 36rpx;
  252 + width:2rpx;
  253 + height:60rpx;
  254 + background:rgba(181,222,150,1);
  255 + opacity:1;
  256 + border-radius:4rpx;
  257 +}
  258 +.mid_item_bottom_bot{
  259 + font-size:24rpx;
  260 + font-family:PingFang SC;
  261 + font-weight:400;
  262 + color:rgba(153,153,153,1);
  263 + opacity:1;
  264 + overflow: hidden;
  265 + text-overflow: ellipsis;
  266 + white-space: nowrap;
  267 +}
  268 +.text_color{
  269 + width:202rpx;
  270 + height:48rpx;
  271 + line-height: 48rpx;
  272 + text-align: center;
  273 + background:rgba(204,204,204,0.7);
  274 + font-size:24rpx;
  275 + font-family:PingFang SC;
  276 + font-weight:400;
  277 + color:rgba(255,255,255,1);
  278 + opacity:1;
  279 + overflow: hidden;
  280 + text-overflow: ellipsis;
  281 + white-space: nowrap;
  282 +}
  283 +.right_bottom_lef{
  284 + width: 140rpx;
  285 + overflow: hidden;
  286 + text-overflow: ellipsis;
  287 + white-space: nowrap;
  288 +}
  1 +// pages/homeindex/search/search.js
  2 +const app = getApp()
  3 +Page({
  4 +
  5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + recommend: [],
  10 + history: [],
  11 + keyword: '',
  12 + page:''
  13 + },
  14 +
  15 + /**
  16 + * 生命周期函数--监听页面加载
  17 + */
  18 + onLoad: function(options) {
  19 + let that = this
  20 + that.get_info()
  21 + },
  22 + bindKeyInput:function(e){
  23 + console.log(e.detail.value)
  24 + this.setData({
  25 + keyword: e.detail.value
  26 + })
  27 + },
  28 + get_info() {
  29 + let that = this
  30 + // 接口地址
  31 + let url = app.interface.history
  32 + let header = {
  33 + 'XX-Device-Type': 'wxapp',
  34 + 'XX-Token': wx.getStorageSync('token')
  35 + }
  36 +
  37 + app.post(url, {}, header).then((res) => {
  38 + console.log(res)
  39 + that.setData({
  40 + recommend: res.data.recommend,
  41 + history: res.data.history
  42 + })
  43 +
  44 + }).catch((errMsg) => {
  45 +
  46 + })
  47 +
  48 + },
  49 + info(event) {
  50 + let that = this
  51 + // 接口地址
  52 + let url = app.interface.shopPage
  53 + let header = {
  54 + 'XX-Device-Type': 'wxapp',
  55 + 'XX-Token': wx.getStorageSync('token')
  56 + }
  57 +
  58 +
  59 + let keyword = this.data.keyword
  60 + app.post(url, {
  61 + page: 1,
  62 + keyword: keyword
  63 + },header).then((res) => {
  64 + that.setData({
  65 + shop: res.data.shop
  66 + })
  67 + }).catch((errMsg) => {
  68 +
  69 + })
  70 + },
  71 + clear(){
  72 + let that =this
  73 + let url = app.interface.historyDelete
  74 + let header = {
  75 + 'XX-Device-Type': 'wxapp',
  76 + 'XX-Token': wx.getStorageSync('token')
  77 + }
  78 + app.post(url, {}, header).then((res) => {
  79 + console.log(history)
  80 +
  81 + that.setData({
  82 + history: []
  83 + })
  84 + console.log(111)
  85 +
  86 +
  87 + }).catch((errMsg) => {
  88 +
  89 + })
  90 +
  91 + },
  92 + add(){
  93 +
  94 + },
  95 + /**
  96 + * 生命周期函数--监听页面初次渲染完成
  97 + */
  98 + onReady: function() {
  99 +
  100 + },
  101 +
  102 + /**
  103 + * 生命周期函数--监听页面显示
  104 + */
  105 + onShow: function() {
  106 +
  107 + },
  108 +
  109 + /**
  110 + * 生命周期函数--监听页面隐藏
  111 + */
  112 + onHide: function() {
  113 +
  114 + },
  115 +
  116 + /**
  117 + * 生命周期函数--监听页面卸载
  118 + */
  119 + onUnload: function() {
  120 +
  121 + },
  122 +
  123 + /**
  124 + * 页面相关事件处理函数--监听用户下拉动作
  125 + */
  126 + onPullDownRefresh: function() {
  127 +
  128 + },
  129 +
  130 + /**
  131 + * 页面上拉触底事件的处理函数
  132 + */
  133 + onReachBottom: function() {
  134 +
  135 + },
  136 +
  137 + /**
  138 + * 用户点击右上角分享
  139 + */
  140 + onShareAppMessage: function() {
  141 +
  142 + }
  143 +})
  1 +{
  2 + "navigationBarTitleText": "",
  3 + "navigationBarBackgroundColor": "#6EAC3D",
  4 + "navigationBarTextStyle": "white"
  5 +}
  1 +<!--pages/homeindex/search/search.wxml-->
  2 +<!-- <text>pages/homeindex/search/search.wxml</text> -->
  3 +<view class='search'>
  4 + <view class='search_inp'>
  5 + <input type='text' placeholder='请输入商品名称' maxlength='12' bindinput='bindKeyInput' value='{{keyword}}'></input>
  6 + <image src='../../../img/search.png'></image>
  7 + </view>
  8 + <view class='search_txt' bindtap='info'>
  9 + 搜索
  10 + </view>
  11 +</view>
  12 +<view class='Popular'>
  13 + <view class='Popular_title'>
  14 + <text>热门搜索</text>
  15 + <image src='../../../img/zuire@3x.png'></image>
  16 + </view>
  17 + <view class='Popular_list' >
  18 + <view class='Popular_item' wx:for='{{recommend}}' wx:key>
  19 + {{recommend[index]}}
  20 + </view>
  21 +
  22 + </view>
  23 + <view class='History'>
  24 + <view class='History_title'>历史搜索
  25 + <image src='../../../img/del.png' bindtap='clear'></image>
  26 + </view>
  27 + <view class='History_list'>
  28 + <view class='History_item' wx:for='{{history}}' wx:key>{{history[index]}}</view>
  29 + </view>
  30 + </view>
  31 +</view>
  32 +<view class='container'>
  33 + <view class='mid'>
  34 + <view class='ware_box' wx:for='{{shop}}' wx:key="index">
  35 + <view class='ware_top'>
  36 + <view class='ware_1'>
  37 + <image src='{{item.thumb}}'></image>
  38 + <view class='ware_1_time'>
  39 + 据结束2时22分
  40 + </view>
  41 + </view>
  42 + <view class='ware_text'>
  43 + <view class='ware_2'>
  44 + <text class='ware_2Txt1'>{{item.name}}</text>
  45 + <text class='ware_2Txt2'>{{item.origin}}</text>
  46 + </view>
  47 + <view class='ware_3'>
  48 + <progress percent="42" show-info color="#B5DE96" border-radius="8" font-size="24rpx" stroke-width="16rpx" />
  49 + </view>
  50 + <view class='ware_4'>
  51 + <text>现有{{item.numb}}份,目标{{item.group}}份</text>
  52 + </view>
  53 + <view class='ware_5'>
  54 + <view>
  55 + <text class='ware5_t1'>{{item.money_sale}}</text>
  56 + <text class='ware5_t2'>{{item.shop_type}}</text>
  57 + </view>
  58 + <view class='ware5_box'>
  59 + <view class='ware5_t3'>{{item.text_table}}</view>
  60 + <view class='ware5_t4'>{{item.text_content}}</view>
  61 + </view>
  62 + <view class='ware_6'>
  63 + <view>立即参团</view>
  64 + </view>
  65 + </view>
  66 + </view>
  67 + </view>
  68 + <view class='ware_bot'>
  69 + <view class='ware_bot_tit'>经典推荐</view>
  70 + <view class='ware_bot_txt'>{{item.recommend}}</view>
  71 + </view>
  72 + </view>
  73 +
  74 + </view>
  75 + <view wx:if="{{shop.length == 0}}">暂无更多结果</view>
  76 +
  77 +
  78 +</view>
  1 +/* pages/homeindex/search/search.wxss */
  2 +.search{
  3 + padding: 16rpx 32rpx;
  4 + height: 64rpx;
  5 + background: #6EAC3D;
  6 + display: flex;
  7 + justify-content: center;
  8 + align-content: space-between;
  9 +}
  10 +.search_inp{
  11 + box-sizing: border-box;
  12 + width: 608rpx;
  13 + height: 64rpx;
  14 + border-radius: 32rpx;
  15 + display:flex;
  16 + align-items: center;
  17 + padding-left: 76rpx;
  18 + padding-right: 32rpx;
  19 + background:#fff;
  20 + border: 0;
  21 + outline: none;
  22 + font-size: 26rpx;
  23 + position: relative;
  24 +}
  25 +.search_inp input{
  26 + width: 100%;
  27 +}
  28 +.search_inp image{
  29 + position: absolute;
  30 + left: 32rpx;
  31 + width: 32rpx;
  32 + height: 32rpx;
  33 +}
  34 +.search_txt{
  35 + height: 64rpx;
  36 + font-size: 30rpx;
  37 + color: #fff;
  38 + line-height: 64rpx;
  39 + padding-left: 16rpx;
  40 +}
  41 +.Popular{
  42 + padding: 32rpx;
  43 + padding-bottom: 0rpx;
  44 +
  45 +}
  46 +.Popular_title{
  47 + display: flex;
  48 + align-items: center;
  49 + font-size: 26rpx;
  50 + color: #333;
  51 + font-weight: 400;
  52 +}
  53 +.Popular_title text{
  54 + margin-right: 12rpx;
  55 +}
  56 +.Popular image{
  57 + width: 28rpx;
  58 + height: 32rpx;
  59 +}
  60 +.Popular_list{
  61 + display: flex;
  62 + justify-content: flex-start;
  63 + flex-wrap: wrap;
  64 + align-items: center;
  65 + margin-top: 28rpx;
  66 + padding-bottom: 16rpx;
  67 + border-bottom: 1rpx solid #F5F5F5;
  68 +}
  69 +.Popular_item,.History_item{
  70 + padding: 8rpx 26rpx;
  71 + border-radius: 24rpx;
  72 + background:rgba(247,247,247,1);
  73 + font-size: 26rpx;
  74 + margin-bottom: 16rpx;
  75 + margin-right: 16rpx;
  76 +}
  77 +.History{
  78 + margin-top: 30rpx;
  79 +}
  80 +.History_title{
  81 + font-size: 26rpx;
  82 + display: flex;
  83 + justify-content: space-between;
  84 + align-items: center;
  85 + color: #333;
  86 + font-weight: 400;
  87 + padding-bottom: 28rpx;
  88 +}
  89 +.History_title img{
  90 + width: 32rpx;
  91 + height: 32rpx;
  92 +}
  93 +.History_list{
  94 + display: flex;
  95 + justify-content: flex-start;
  96 + flex-wrap: wrap;
  97 + align-items: center;
  98 +
  99 +}
  100 +.container{
  101 + width: 750rpx;
  102 + display: flex;
  103 + align-items: center;
  104 + flex-flow: column;
  105 +}
  106 +.mid{
  107 + margin-top: 16rpx;
  108 + display: flex;
  109 + flex-flow: column;
  110 +}
  111 +.ware_box{
  112 + width:688rpx;
  113 + height:400rpx;
  114 + margin:32rpx auto;
  115 + background:#F9FAFC;
  116 +}
  117 +.ware_top{
  118 + overflow: hidden;
  119 + display: flex;
  120 + padding:32rpx 18rpx 0;
  121 +}
  122 +.ware_1{
  123 + width:312rpx;
  124 + height:208rpx;
  125 + position: relative;
  126 +}
  127 +.ware_1 image{
  128 + width:100%;
  129 + height:100%;
  130 +}
  131 +.ware_1_time{
  132 + position: absolute;
  133 + bottom:0;
  134 + width:208rpx;
  135 + height:48rpx;
  136 + color: white;
  137 + text-align: center;
  138 + line-height:48rpx;
  139 + font-size:24rpx;
  140 + background:#FAC8C8;
  141 + font-family:PingFang SC;
  142 +}
  143 +.ware_text{
  144 + margin-left:14rpx;
  145 + width:100%;
  146 +}
  147 +.ware_2{
  148 + display: flex;
  149 + justify-content: space-between;
  150 + align-content: center;
  151 +}
  152 +.ware_2Txt1{
  153 + font-size:32rpx;
  154 + font-family:PingFang SC;
  155 + font-weight:600;
  156 + line-height:44rpx;
  157 + color:rgba(51,51,51,1);
  158 +}
  159 +.ware_2Txt2{
  160 + font-size:22rpx;
  161 + /* margin-left:98rpx; */
  162 + font-family:PingFang SC;
  163 + font-weight:400;
  164 + line-height:32rpx;
  165 + color:rgba(204,204,204,1);
  166 +}
  167 +.ware_3 progress{
  168 + width:370rpx;
  169 + color:#B5DE96;
  170 + margin-top:24rpx;
  171 +}
  172 +.ware_4 text,.ware5_t2{
  173 + font-size:18rpx;
  174 + font-family:PingFang SC;
  175 + font-weight:400;
  176 + line-height:32rpx;
  177 + color:rgba(204,204,204,1);
  178 +}
  179 +.ware_5{
  180 + display: flex;
  181 + display: -webkit-flex;
  182 + justify-content: space-between;
  183 +}
  184 +.ware5_t1{
  185 + font-size:30rpx;
  186 + font-family:DIN 1451 Std Mittelschrift;
  187 + font-weight:400;
  188 + color:rgba(255,0,0,1);
  189 +}
  190 +.ware5_t3{
  191 + font-size:22rpx;
  192 + font-family:PingFang SC;
  193 + font-weight:400;
  194 + line-height:30rpx;
  195 + color:rgba(51,51,51,1);
  196 +}
  197 +.ware5_t4{
  198 + font-size:18rpx;
  199 + font-family:PingFang SC;
  200 + font-weight:400;
  201 + color:rgba(153,153,153,1);
  202 +}
  203 +.ware_6{
  204 + width:144rpx;
  205 + height:48rpx;
  206 + background:rgba(249,150,20,1);
  207 + box-shadow:0px 2rpx 12rpx rgba(255,145,0,0.16);
  208 + border-radius:24rpx;
  209 +}
  210 +.ware_6 view{
  211 + font-size:26rpx;
  212 + font-family:PingFang SC;
  213 + font-weight:400;
  214 + text-align: center;
  215 + line-height:48rpx;
  216 + color:rgba(255,255,255,1);
  217 +}
  218 +.ware_bot{
  219 + width:670rpx;
  220 + height:80rpx;
  221 + margin: auto;
  222 + display: flex;
  223 + line-height:80rpx;
  224 + margin-top:32rpx;
  225 + background-color:#F1F7F1;
  226 +}
  227 +.ware_bot_tit{
  228 + font-size:30rpx;
  229 + font-weight:bold;
  230 + margin-left:32rpx;
  231 + color:rgba(110,172,61,1);
  232 +}
  233 +.ware_bot_tit:after{
  234 + content:"";
  235 + margin:0 38rpx;
  236 + border-right:1px solid #B5DE96;
  237 +}
  238 +.ware_bot_txt{
  239 + font-size:24rpx;
  240 + font-family:PingFang SC;
  241 + font-weight:400;
  242 + color:rgba(153,153,153,1);
  243 +}
  244 +/* 规格 */
  245 +.spec{
  246 + width:100%;
  247 + padding:0 32rpx;
  248 + line-height:80rpx;
  249 + display: flex;
  250 + height:80rpx;
  251 + margin-top:8rpx;
  252 + background:white;
  253 +}
  254 +.spec_txt{
  255 + font-size:32rpx;
  256 + font-family:PingFang SC;
  257 + font-weight:400;
  258 + color:rgba(51,51,51,1);
  259 +}
  260 +.spec_txt2{
  261 + font-size:24rpx;
  262 + font-family:PingFang SC;
  263 + font-weight:400;
  264 + margin-left:108rpx;
  265 + color:rgba(153,153,153,1);
  266 +}
  267 +/* 商品详情 */
  268 +.ware_detail{
  269 + width:100%;
  270 + margin-top:8rpx;
  271 + margin-bottom:96rpx;
  272 + padding-bottom:66rpx;
  273 + background: white;
  274 +}
  275 +.ware_detail_tit{
  276 + width:688rpx;
  277 + margin: auto;
  278 + display: flex;
  279 + padding:44rpx 0rpx 42rpx;
  280 + justify-content:space-around;
  281 + border-bottom:2rpx solid #F5F5F5;
  282 +}
  283 +.ware_detail .ware_active{
  284 + color:#6EAC3D;
  285 + font-weight:600;
  286 +}
  287 +.ware_active:after{
  288 + content: "";
  289 + width:16rpx;
  290 + height: 6rpx;
  291 + margin: auto;
  292 + display: block;
  293 + margin-top:6rpx;
  294 + border-radius:8rpx;
  295 + background:rgba(110,172,61,1);
  296 +}
  297 +.ware_detail_tit view{
  298 + font-size:28rpx;
  299 + font-family:PingFang SC;
  300 + font-weight:400;
  301 + color:rgba(153,153,153,1);
  302 +}
  303 +.ware_detailC{
  304 + width:688rpx;
  305 + margin:26rpx auto 0;
  306 +}
  307 +
  308 +.ware_detailImg{
  309 + width:688rpx;
  310 + height:470rpx;
  311 +}
  312 +.ware_detailImg image{
  313 + width:100%;
  314 + height:100%;
  315 +}
  1 +//index.js
  2 +//获取应用实例
  3 +const app = getApp()
  4 +
  5 +Page({
  6 + data: {
  7 + session_key:'',
  8 + openid:''
  9 + },
  10 +
  11 +
  12 +
  13 + /**
  14 + * 生命周期函数--监听页面加载
  15 + */
  16 + onLoad: function (options) {
  17 + this.getLoginFun();
  18 + },
  19 +
  20 + // 获取session_key
  21 + getLoginFun() {
  22 + let that = this;
  23 + wx.login({
  24 + success: function (s) {
  25 + console.log(s);
  26 + wx.setStorageSync("token", 123123);
  27 +
  28 + let url = 'wxapp/public/getSessionKey';
  29 + if (s.code) {
  30 + var code = s.code;
  31 + var param = {
  32 + code: s.code
  33 + }
  34 + app.post(url, param).then((res) => {
  35 + console.log(res);
  36 + that.setData({
  37 + openid: res.data.openid,
  38 + session_key: res.data.session_key
  39 + })
  40 + // res.data = {}
  41 +
  42 + }).catch((errMsg) => {
  43 + console.log(errMsg);
  44 + })
  45 + }
  46 + }
  47 + });
  48 + },
  49 +
  50 + // 获取用户信息
  51 + getUserInfo(e) {
  52 + console.log(e);
  53 +
  54 + let url = "wxapp/public/login";
  55 + let data = {
  56 + openid: this.data.openid,
  57 + session_key: this.data.session_key,
  58 + encrypted_data: e.detail.encryptedData,
  59 + iv: e.detail.iv,
  60 + }
  61 + app.post(url, data).then((res) => {
  62 + console.log(res);
  63 + wx.setStorageSync("token", res.data.token);
  64 + wx.switchTab({
  65 + url: '../homeindex/homeindex',
  66 + })
  67 + }).catch((err) => {
  68 + console.log(err);
  69 + })
  70 + },
  71 +
  72 +
  73 +
  74 +
  75 + // start(e) {
  76 +
  77 + // let that = this;
  78 + // console.log(e)
  79 +
  80 + // // app.globalData.userInfo = e.detail.userInfo
  81 + // wx.login({
  82 + // success: (res) => {
  83 + // console.log(res)
  84 + // let url = '/api/portal/common/getToken';
  85 + // let params = {
  86 + // code: res.code,
  87 + // user_nickname: e.detail.userInfo.nickName,
  88 + // avatar: e.detail.userInfo.avatarUrl
  89 + // // user_nickname: e.detail.userInfo.nickName,
  90 + // // avatar: e.detail.userInfo.avatarUrl //分享进入的需要此参数
  91 + // }
  92 + // app.post(url, params).then((res) => {
  93 + // console.log('999', res)
  94 + // wx.setStorageSync('token', res.token);
  95 +
  96 + // wx.navigateTo({
  97 + // url: "/pages/mainindex/mainindex",
  98 + // })
  99 +
  100 + // // wx.switchTab({
  101 + // // url: '../mainindex/mainindex',
  102 + // // })
  103 +
  104 + // }).catch((errMsg) => {
  105 + // // console.log(errMsg)
  106 + // })
  107 +
  108 + // }
  109 + // });
  110 + // },
  111 +})
  1 +{
  2 + "usingComponents": {}
  3 +}