银花优选微信小程序修改后的最新版本代码

This commit is contained in:
ss001
2026-02-07 16:22:31 +08:00
commit c00caf5744
516 changed files with 41796 additions and 0 deletions

194
pages/othershop/index.js Normal file
View File

@@ -0,0 +1,194 @@
//获取应用实例
var app = getApp()
var sopenFrame=null
var that=null
var that0=null
Page({
data: {
indicatorDots: true,
vertical: false,
autoplay: true,
interval: 6000,
duration: 1000,
loadingHidden: false, // loading
nodataHidden:false,
t:8,
images:[],
images0:[],
groups:[]
},onShow: function () {
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
that0=this;
var userId = wx.getStorageSync("userId")
var userInfodata = wx.getStorageSync("userInfo")
var sel=3;
var ifsel=0;
if(userId&&userInfodata){
var userInfo = JSON.parse(userInfodata)
ifsel=userInfo.bdshEnable;
}
if(ifsel==1){
sel=2;
that0.getTabBar().setData({
"list": [
{
"pagePath": "/pages/index/index",
"text": "首页",
"iconPath": "/images/footer-icon-01.png",
"selectedIconPath": "/images/footer-icon-01-active.png"
},
{
"pagePath": "/pages/news/index",
"iconPath": "/images/footer-icon-05.png",
"selectedIconPath": "/images/footer-icon-05-active.png",
"text": "资讯"
},
{
"pagePath": "/pages/my/index",
"text": "我的",
"iconPath": "/images/footer-icon-04.png",
"selectedIconPath": "/images/footer-icon-04-active.png"
}
]
})
}else{
that0.getTabBar().setData({
"list": [
{
"pagePath": "/pages/index/index",
"text": "首页",
"iconPath": "/images/footer-icon-01.png",
"selectedIconPath": "/images/footer-icon-01-active.png"
},
{
"pagePath": "/pages/news/index",
"iconPath": "/images/footer-icon-05.png",
"selectedIconPath": "/images/footer-icon-05-active.png",
"text": "资讯"
},
{
"pagePath": "/pages/business/index",
"iconPath": "/images/footer-icon-02.png",
"selectedIconPath": "/images/footer-icon-02-active.png",
"text": "门店"
},
{
"pagePath": "/pages/my/index",
"text": "我的",
"iconPath": "/images/footer-icon-04.png",
"selectedIconPath": "/images/footer-icon-04-active.png"
}
]
})
}
that0.getTabBar().setData({
selected: sel
})
}
},
onLoad: function() {
that = this
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")
var selcityid = wx.getStorageSync("selcityid")
var selcountyid = wx.getStorageSync("selcountyid")
var dlMemberId = wx.getStorageSync("dlMemberId")
wx.request({
url: app.globalData.apiurl + "/xapiajax.ashx",
data: {
action:"getothershopdata",
userId:(!userId?"":userId),
LoginId:(!LoginId?"":LoginId),
selcityid:(!selcityid?"":selcityid),
selcountyid:(!selcountyid?"":selcountyid),
dlMemberId:(!dlMemberId?"":dlMemberId),
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{
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
})
}
})

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "事业联盟部"
}

View 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/othershop/index.wxss Normal file
View 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;
}