银花优选微信小程序修改后的最新版本代码
This commit is contained in:
137
pages/othershop00/index.js
Normal file
137
pages/othershop00/index.js
Normal file
@@ -0,0 +1,137 @@
|
||||
//获取应用实例
|
||||
var app = getApp()
|
||||
var sopenFrame=null
|
||||
var that=null
|
||||
Page({
|
||||
data: {
|
||||
indicatorDots: true,
|
||||
vertical: false,
|
||||
autoplay: true,
|
||||
interval: 6000,
|
||||
duration: 1000,
|
||||
loadingHidden: false, // loading
|
||||
nodataHidden:true,
|
||||
t:9,
|
||||
images:[],
|
||||
images0:[],
|
||||
groups:[]
|
||||
},onShow: function () {
|
||||
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
||||
this.getTabBar().setData({
|
||||
selected: 2
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
onLoad: function(options) {
|
||||
that = this
|
||||
if(options.t){
|
||||
that.setData({
|
||||
t:options.t
|
||||
});
|
||||
} if(that.data.t==9){
|
||||
wx.setNavigationBarTitle({
|
||||
title: "客服专区1"
|
||||
})
|
||||
}else{
|
||||
wx.setNavigationBarTitle({
|
||||
title: " 事业联盟部"
|
||||
})
|
||||
}
|
||||
|
||||
that.rdata(0)
|
||||
}, // 下拉刷新
|
||||
onPullDownRefresh: function () {
|
||||
//在当前页面显示导航条加载动画
|
||||
wx.showNavigationBarLoading();
|
||||
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
|
||||
wx.showLoading({
|
||||
title: '刷新中...',
|
||||
})
|
||||
that.rdata(1);//第一次加载数据
|
||||
},rdata:function(tt) {
|
||||
|
||||
try{
|
||||
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var LoginId = wx.getStorageSync("LoginId")
|
||||
wx.request({
|
||||
url: app.globalData.apiurl + "/xapiajax.ashx",
|
||||
data: {
|
||||
action:"getothershopdata",
|
||||
userId:(!userId?"":userId),
|
||||
LoginId:(!LoginId?"":LoginId),
|
||||
t:that.data.t
|
||||
},
|
||||
method:"GET",
|
||||
dataType:"json",
|
||||
header: {
|
||||
"content-type": "application/json" // 默认值
|
||||
},
|
||||
success (res) {
|
||||
if(res.data.status==1){
|
||||
that.setData({
|
||||
images: res.data.pic,
|
||||
images0: res.data.productlbs,
|
||||
groups: res.data.productlb,
|
||||
loadingHidden:true
|
||||
})
|
||||
if(res.data.productlb.length==0){
|
||||
that.setData({
|
||||
nodataHidden:false
|
||||
})
|
||||
}else{
|
||||
that.setData({
|
||||
nodataHidden:true
|
||||
})
|
||||
}
|
||||
}else{
|
||||
if(res.data.msg=="您未登录"){
|
||||
wx.removeStorageSync('userId')
|
||||
wx.removeStorageSync('LoginId')
|
||||
}
|
||||
}
|
||||
if(tt==1){
|
||||
//隐藏loading 提示框
|
||||
wx.hideLoading();
|
||||
//隐藏导航条加载动画
|
||||
wx.hideNavigationBarLoading();
|
||||
//停止下拉刷新
|
||||
wx.stopPullDownRefresh();
|
||||
}
|
||||
}
|
||||
})
|
||||
}catch(err){
|
||||
wx.showToast({
|
||||
title: err,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
},gotolb:function(e) {
|
||||
var id = e.currentTarget.dataset.id
|
||||
wx.navigateTo({
|
||||
url: "../list/index?id="+id
|
||||
})
|
||||
},gotodetail:function(e) {
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var LoginId = wx.getStorageSync("LoginId")
|
||||
if(userId&&LoginId){
|
||||
var id = e.currentTarget.dataset.id
|
||||
wx.navigateTo({
|
||||
url: "../details/index?id="+id
|
||||
})
|
||||
}else{
|
||||
wx.navigateTo({
|
||||
url: "../login/index"
|
||||
})
|
||||
}
|
||||
},onslide: function (e) {
|
||||
var url = e.currentTarget.dataset.id
|
||||
|
||||
wx.navigateTo({
|
||||
url: url
|
||||
})
|
||||
}
|
||||
})
|
||||
3
pages/othershop00/index.json
Normal file
3
pages/othershop00/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
66
pages/othershop00/index.wxml
Normal file
66
pages/othershop00/index.wxml
Normal file
@@ -0,0 +1,66 @@
|
||||
<!--index.wxml-->
|
||||
<view class="container">
|
||||
<view class="swiper">
|
||||
<swiper class="swiper_box" indicator-dots="{{indicatorDots}}" vertical="{{vertical}}" circular="true"
|
||||
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" bindchange="swiperchange">
|
||||
<block wx:for="{{images}}" wx:key="index">
|
||||
<swiper-item bindtap="onslide" data-id="{{item.url}}">
|
||||
<image src="{{item.img}}" class="slide-image"/>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="menudata_box">
|
||||
<view>
|
||||
<swiper class="swiper_box0" indicator-dots="{{indicatorDots}}" vertical="{{vertical}}" circular="true"
|
||||
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" bindchange="swiperchange0">
|
||||
<swiper-item wx:for="{{images0}}">
|
||||
<view wx:for="{{item.datas}}" wx:for-item="cell" wx:for-index="index0" bindtap="gotolb" data-id='{{cell.id+"&title="+cell.label+"&t=8"}}'>
|
||||
<image src='{{cell.img}}'></image>
|
||||
<text>{{cell.label}}</text>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
<view class="container_box">
|
||||
<block wx:for="{{groups}}" wx:for-index="groupindex">
|
||||
<view class="choice_text">
|
||||
<view class="line_flag"></view>
|
||||
<text>{{item.name}}</text>
|
||||
<view class="more" bindtap="gotolb" data-id="{{item._id}}&title={{item.name}}&t=8">更多>></view>
|
||||
</view>
|
||||
<view class="choice_box">
|
||||
<view class="choice_list">
|
||||
<block wx:for="{{item.productlist}}" wx:for-item="cell" wx:for-index="index0">
|
||||
<view class='block block0{{(index0%2)==1?" r":" l"}}' bindtap="gotodetail" data-id="{{cell._id}}">
|
||||
<view class='choice_item'>
|
||||
<image src="{{cell.image}}"/>
|
||||
<view class="title">{{cell.name}}</view>
|
||||
<view class="je">
|
||||
|
||||
<view class="jeto">
|
||||
<view>零售价: </view>
|
||||
<view class="scje">¥{{cell.scje}}</view>
|
||||
</view>
|
||||
<view class="jeto">
|
||||
<view>会员价:</view>
|
||||
<view class="hyje">{{cell.hyje}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="nodata" hidden="{{nodataHidden}}">
|
||||
<image src="../../images/order-null.png"/>
|
||||
<view>暂无商品</view>
|
||||
</view>
|
||||
<loading hidden="{{loadingHidden}}">
|
||||
加载中...
|
||||
</loading>
|
||||
|
||||
</view>
|
||||
211
pages/othershop00/index.wxss
Normal file
211
pages/othershop00/index.wxss
Normal file
@@ -0,0 +1,211 @@
|
||||
page{
|
||||
background: #ccc;
|
||||
}
|
||||
.container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
padding: 0.8em;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.swiper_box {
|
||||
width: 100%;
|
||||
min-height: 16em;
|
||||
margin-bottom: 0.8em;
|
||||
}
|
||||
|
||||
swiper-item image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: inline-block;
|
||||
border-radius:0.5em;
|
||||
}
|
||||
.menudata_box{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding:0;
|
||||
box-sizing: border-box;
|
||||
z-index: 10;
|
||||
}
|
||||
.menudata_box view{
|
||||
display:block;
|
||||
float:left;
|
||||
width: 100%;
|
||||
padding: 0.4em 0;
|
||||
padding-bottom: 0.4em;
|
||||
border-radius:0.5em;
|
||||
background-color:#fff;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.menudata_box view .swiper_box0 {
|
||||
display:block;
|
||||
float:left;
|
||||
width: 100%;
|
||||
height:11em;
|
||||
}
|
||||
.menudata_box .swiper_box0 .wx-swiper-dots{bottom: 0em;}
|
||||
.menudata_box view view{
|
||||
float: left;
|
||||
display: flex;
|
||||
width: 25%;
|
||||
height: 6em;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
font-size:0.9em;
|
||||
}
|
||||
|
||||
.menudata_box view view image{
|
||||
width: 3em;
|
||||
height: 3em;
|
||||
padding:0;
|
||||
background-color: #f5f5f5;
|
||||
border-radius:0.4em;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.menudata_box view view text{
|
||||
margin-top: 0.4em;
|
||||
|
||||
}
|
||||
|
||||
.container_box{
|
||||
margin-top: 0.8em;
|
||||
margin-bottom:6em;
|
||||
background-color: #fff;
|
||||
border-radius:0.5em;
|
||||
}
|
||||
.choice_text{
|
||||
margin-top: 0.5em;
|
||||
width:100%;
|
||||
line-height: 2.5em;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
border-bottom:1px solid #f1f1f1;
|
||||
}
|
||||
.choice_text .line_flag{
|
||||
margin-top: 0em;
|
||||
margin-left: 0.5em;
|
||||
margin-right: 0.5em;
|
||||
width:0.5em;
|
||||
height: 1.5em;
|
||||
line-height: 1.5em;
|
||||
background-color: #00B050;
|
||||
border-radius:0.2em;
|
||||
}
|
||||
.choice_text text{
|
||||
flex-grow: 1;
|
||||
font-weight: 800;
|
||||
}
|
||||
.choice_text .more{
|
||||
width:4em;
|
||||
}
|
||||
|
||||
.choice_box {
|
||||
float: left;
|
||||
width:100%;
|
||||
padding:0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.choice_box .choice_list .block{
|
||||
float: left;
|
||||
width: 100%;
|
||||
padding:0.5em;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.choice_box .choice_list .block.block0{
|
||||
width: 50%;
|
||||
padding: 0.5em;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
.choice_box .choice_list .block.block0.l{
|
||||
padding-right: 0.25em;
|
||||
}
|
||||
.choice_box .choice_list .block.block0.r{
|
||||
padding-left: 0.25em;
|
||||
}
|
||||
.choice_box .choice_list .block .choice_item{
|
||||
float: left;
|
||||
width: 100%;
|
||||
padding:0;
|
||||
border:1px solid #f1f1f1;
|
||||
background-color: #f5f5f5;
|
||||
border-radius:0.5em;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
.choice_box .choice_list .block image {
|
||||
width: 100%;
|
||||
height:90vw;
|
||||
}
|
||||
.choice_box .choice_list .block.block0 image {
|
||||
width: 100%;
|
||||
height:46vw;
|
||||
}
|
||||
|
||||
.choice_box .choice_list .title {
|
||||
float: left;
|
||||
padding:0 0.5em;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
.choice_box .choice_list .je {
|
||||
float: right;
|
||||
width:auto;
|
||||
display: flex;
|
||||
flex-direction:column;
|
||||
align-items:flex-end;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
color: #939393;
|
||||
padding:0 0.5em;
|
||||
padding-bottom: 0.5em;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.choice_box .choice_list .je .jeto{
|
||||
display: flex;
|
||||
flex-direction:row;
|
||||
margin-top: 0.8em;
|
||||
background-color: #00B050;
|
||||
padding: 0.4em 0.4em;
|
||||
color:#fff;
|
||||
border-radius:0.5em;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.choice_box .choice_list .je .jeto .scje{
|
||||
text-decoration:line-through;
|
||||
}
|
||||
|
||||
|
||||
.choice_box .choice_list .block.block0 .title{
|
||||
width:100%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.choice_box .choice_list .block.block0 .je {
|
||||
float: left;
|
||||
width:100%;
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
.choice_box .choice_list .block.block0 .je .jeto .hyje{
|
||||
margin-top: 0.15em;
|
||||
}
|
||||
|
||||
.nodata{padding-top:1em; text-align: center; line-height: 1.5em; color:#939393;}
|
||||
.nodata image {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
Reference in New Issue
Block a user