项目代码

main
雷玉萍 2 years ago
parent 7dd0d2fe45
commit 6ed3004597

@ -0,0 +1,94 @@
# 校园二手交易微信小程序
校园二手交易微信小程序实现的功能:定位大学,当地天气,轮播图,推荐列表,购物车,发布功能,订单,身份验证等。
**以下对每一项进行了简单的阐述,“详情”则是对每一项内容具体的描述。**
## 首页
首页实现了一些简单的功能,而且界面的设计也不是美观,设计的比较粗糙,后续会完善的功能是:用户下滑加载更多的内容,内容也会更加丰富。
<img src="https://raw.githubusercontent.com/zhuyuzhu/images/master/pictures/homePage.jpg" width="300" alt="首页"/>
#### 定位
定位功能调用的是百度的接口,本来是想腾讯地图的,但是自己在使用的过程中,出现了一些错误(后续会完善腾讯地图的使用),导致调用接口失败了,然后才用的[百度地图web端的api](http://lbsyun.baidu.com/index.php?title=jspopular),而且官方给了代码实例,我们稍作修改即可使用。 [定位详情](https://blog.csdn.net/zyz00000000/article/details/82531397)
<img src="https://raw.githubusercontent.com/zhuyuzhu/images/master/pictures/location.jpg" width="300" alt="定位"/>
#### 天气
天气功能调用的是百度的接口,在百度地图官网给的代码实例里面除了位置功能,还有当地天气的数据,可以直接拿来使用。[天气详情](https://blog.csdn.net/zyz00000000/article/details/82531397)
<img src="https://raw.githubusercontent.com/zhuyuzhu/images/master/pictures/weather.jpg" width="300" alt="天气"/>
#### 轮播图
轮播图直接用微信小程序的组件,&lt;swiper&gt;设置轮播图属性——> &lt;block&gt;循环遍历每一项——> &lt;swiper-item&gt;轮播每一项——> &lt;image&gt;每一项的图片。[详情](https://developers.weixin.qq.com/miniprogram/dev/component/swiper.html)
<img src="https://raw.githubusercontent.com/zhuyuzhu/images/master/pictures/swiper.jpg" width="300" alt="轮播效果图"/>
下面是代码截图:
<img src="https://raw.githubusercontent.com/zhuyuzhu/images/master/pictures/swiper1.jpg" width="900" alt="轮播图wxml"/>
<img src="https://raw.githubusercontent.com/zhuyuzhu/images/master/pictures/swiper2.jpg" width="300" alt="轮播图js"/>
#### 搜索框
首页的所搜框用的是一张图片,当然这样的搜索框,微信小程序是有组件的,
[微信小程序的icon组件](https://developers.weixin.qq.com/miniprogram/dev/component/icon.html)
<img src="https://raw.githubusercontent.com/zhuyuzhu/images/master/pictures/search-book.jpg" width="300" alt="搜索框图片"/>
#### 滚动条
我采用引入模板的方式,将这个功能写好后,引入到首页,同样用的&lt;swiper&gt;标签。[详情](https://developers.weixin.qq.com/miniprogram/dev/component/swiper.html)
<img src="https://raw.githubusercontent.com/zhuyuzhu/images/master/pictures/swiper-y.jpg" width="300" alt="校园头条"/>
下面是代码截图:
<img src="https://raw.githubusercontent.com/zhuyuzhu/images/master/pictures/swiper-y1.jpg" width="800" alt="校园头条wxml"/>
#### 四个分类功能
分类功能实现的也比较简单没有什么技术性的东西或许wxss样式对你有所帮助。
<img src="https://raw.githubusercontent.com/zhuyuzhu/images/master/pictures/classify.jpg" width="300" alt="四个分类"/>
#### 今日推荐
今日推荐功能使用了[微信小程序的scroll-view](https://developers.weixin.qq.com/miniprogram/dev/component/scroll-view.html),要注意的是,推荐好书和推荐好物在同一个页面,那么当点击“更多”的时候,要跳转到相应内容上。
<img src="https://raw.githubusercontent.com/zhuyuzhu/images/master/pictures/recommend.jpg" width="300" alt="今日推荐"/>
## 购物车
购物车的实现也较为简单将用户id和商品id传给后端后端才能把对应的数据给前端。[详情](https://blog.csdn.net/zyz00000000/article/details/82532998)
<img src="https://github.com/zhuyuzhu/images/blob/master/pictures/shoppingCart.jpg" width="300" alt="购物车"/>
## 发布
发布功能,注意一点,必填的内容都填了“发布”按钮才可以点击
<img src="https://github.com/zhuyuzhu/images/blob/master/pictures/release.jpg" width="300" alt="发布功能"/>
## 订单
订单功能,请求数据,展示数据,没什么难度
<img src="https://github.com/zhuyuzhu/images/blob/master/pictures/order.jpg" width="300" alt="订单管理"/>
## 我的
样式,每一项后面有的" > "是如何实现的呢?
通过伪元素transform: matrix()实现>的效果。
<img src="https://github.com/zhuyuzhu/images/blob/master/pictures/1.png" width="300" alt="样式"/>
<img src="https://github.com/zhuyuzhu/images/blob/master/pictures/2.jpg" width="600" alt="代码"/>
<img src="https://github.com/zhuyuzhu/images/blob/master/pictures/my.jpg" width="300" alt="个人信息"/>
## 身份验证
#### 因为需要学校的学生身份才可以使用小程序的功能,这里给出一个测试的账号和密码
#### 账号20151621029 密码666666
<img src="https://github.com/zhuyuzhu/images/blob/master/pictures/identityVerify.jpg" width="300" alt="身份验证"/>
### 校园兼职
#### 用户可以通过小程序,发布兼职信息,发布的兼职信息会在“首页——校园兼职”中,可以在兼职列表中查看兼职的详情
<img src="https://github.com/zhuyuzhu/images/blob/master/pictures/partTimeJob.jpg" width="300" alt="身份验证"/>
#### 当点击“家教老师”这则兼职的时候,会跳转到相应的详情页面
<img src="https://github.com/zhuyuzhu/images/blob/master/pictures/parTimeJobDetail.jpg" width="300" alt="身份验证"/>
### 商品详细
<img src="https://github.com/zhuyuzhu/images/blob/master/pictures/goodsDetail.jpg" width="300" alt="身份验证"/>
#### 预约购买
<img src="https://github.com/zhuyuzhu/images/blob/master/pictures/buyGoods.jpg" width="300" alt="身份验证"/>

@ -0,0 +1,162 @@
//app.js
var Bmob = require('utils/bmob.js');
Bmob.initialize("59c6af950c7ae5ae07df0e5291cdf708", "1be7b1ea080e159e483a330dba10cd07");
App({
onLaunch: function () {
var user = new Bmob.User();//开始注册用户
var newOpenid = wx.getStorageSync('openid')
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
if (!newOpenid) {
wx.login({
success: function (res) {
user.loginWithWeapp(res.code).then(function (user) {
var openid = user.get("authData").weapp.openid;
console.log(user, 'user', user.id, res);
if (user.get("nickName")) {
// 第二次访问
console.log(user.get("nickName"), 'res.get("nickName")');
wx.setStorageSync('openid', openid)
} else {
//保存用户其他信息
wx.getUserInfo({
success: function (result) {
var userInfo = result.userInfo;
var nickName = userInfo.nickName;
var avatarUrl = userInfo.avatarUrl;
var gender = userInfo.gender;
var u = Bmob.Object.extend("_User");
var query = new Bmob.Query(u);
// 这个 id 是要修改条目的 id你在生成这个存储并成功时可以获取到请看前面的文档
query.get(user.id, {
success: function (result) {
// 自动绑定之前的账号
result.set('nickName', nickName);
result.set("userPic", avatarUrl);
result.set("openid", openid);
result.set("gender", gender);
result.save();
}
});
}
});
}
}, function (err) {
console.log(err, 'errr');
});
}
});
}
// 获取用户信息
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
wx.getUserInfo({
success: res => {
// 可以将 res 发送给后台解码出 unionId
this.globalData.userInfo = res.userInfo
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
}
}
})
}
// res.authSetting['scope.userLocation'] == undefined 表示 初始化进入该页面
// res.authSetting['scope.userLocation'] == false 表示 非初始化进入该页面,且未授权
// res.authSetting['scope.userLocation'] == true 表示 地理位置授权
if (res.authSetting['scope.userLocation'] != undefined && res.authSetting['scope.userLocation'] != true) {
wx.showModal({
title: '请求授权当前位置',
content: '需要获取您的地理位置,请确认授权',
success: function (res) {
if (res.cancel) {
wx.showToast({
title: '拒绝授权',
icon: 'none',
duration: 1000
})
} else if (res.confirm) {
wx.openSetting({
success: function (dataAu) {
if (dataAu.authSetting["scope.userLocation"] == true) {
wx.showToast({
title: '授权成功',
icon: 'success',
duration: 1000
})
//再次授权调用wx.getLocation的API
} else {
wx.showToast({
title: '授权失败',
icon: 'none',
duration: 1000
})
}
}
})
}
}
})
} else if (res.authSetting['scope.userLocation'] == undefined) {
//调用wx.getLocation的API
}
else {
//调用wx.getLocation的API
}
}
})
},
getUserInfo: function (cb) {
var that = this
if (this.globalData.userInfo) {
typeof cb == "function" && cb(this.globalData.userInfo)
} else {
//调用登录接口
wx.login({
success: function () {
wx.getUserInfo({
success: function (res) {
that.globalData.userInfo = res.userInfo
typeof cb == "function" && cb(that.globalData.userInfo)
}
})
}
})
}
},
globalData: {
userInfo: null
},
// 下拉刷新
// 获取电影的数据URL
globalData: {
userInfo: null,
// huanbaoBase: 'https://www.hukebme.com/', //唤宝的网址
huanbaoBase: 'http://192.168.0.111/',
// doubanBase: 'https://douban.uieee.com',
//huanbaoBase: 'http://localhost/',
ResourcesURL: '/v2/movie/search?q=',
inThearters: '/v2/movie/in_theaters',//热映
comingSoon: '/v2/movie/coming_soon',//即将上映
subject: '/v2/movie/subject/'
},
})

@ -0,0 +1,85 @@
{
"pages": [
"pages/shouye/shouye",
"pages/shoppingCart/shoppingCart",
"pages/my/my",
"pages/logs/logs",
"pages/index/index",
"pages/release/release",
"pages/order/order",
"pages/search/search",
"pages/search-book/search-book",
"pages/post/post",
"pages/weather/weather",
"pages/movie-detail/movie-detail",
"pages/components/news/news",
"pages/components/weatherLocationTrand/weatherLocationTrand",
"pages/components/recommend/recommend",
"pages/sonShouye/movie-more/movie-more",
"pages/sonShouye/movie-list/movie-list",
"mapWeather/search/search",
"mapWeather/regeocoding/regeocoding",
"mapWeather/suggestion/suggestion",
"mapWeather/weather/weather",
"pages/my/mySetting/mySetting",
"pages/my/myPost/myPost",
"pages/my/myorder/myorder",
"pages/my/purchaseHistory/purchaseHistory",
"pages/my/addressAdmin/addressAdmin",
"pages/my/myCart/myCart",
"pages/my/systemNotification/systemNotification",
"pages/classify/thing-search/thing-search",
"pages/classify/sale/sale",
"pages/classify/welfare/welfare",
"pages/classify/job/job",
"pages/sonShouye/headline/headline",
"pages/classify/jobDetail/jobDetail",
"pages/thing-detail/thing-detail",
"pages/search-thing-result/search-thing-result",
"pages/settlement/settlement"
],
"window": {
"navigationBarBackgroundColor": "#1E68C9",
"backgroundTextStyle": "dark",
"navigationBarTitleText": "校园二手交易",
"navigationBarTextStyle": "#fff",
"enablePullDownRefresh": true
},
"tabBar": {
"list": [
{
"text": "首页",
"pagePath": "pages/shouye/shouye",
"iconPath": "images/tabBar/home.png",
"selectedIconPath": "images/tabBar/home.fill.png"
},
{
"text": "购物车",
"pagePath": "pages/shoppingCart/shoppingCart",
"iconPath": "images/tabBar/shoppingCart.png",
"selectedIconPath": "images/tabBar/shoppingCart.fill.png"
},
{
"text": "发布",
"pagePath": "pages/post/post",
"iconPath": "images/tabBar/release.png",
"selectedIconPath": "images/tabBar/release.png"
},
{
"text": "订单",
"pagePath": "pages/order/order",
"iconPath": "images/tabBar/order.png",
"selectedIconPath": "images/tabBar/order.fill.png"
},
{
"text": "我的",
"pagePath": "pages/my/my",
"iconPath": "images/tabBar/mine.png",
"selectedIconPath": "images/tabBar/mine.fill.png"
}
],
"color": "#000000",
"selectedColor": "#1E68C9"
},
"debug": true
}

@ -0,0 +1,159 @@
/**app.wxss**/
@import "./style/weui.wxss";
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
page {
background-color: #f3f3f3;
font-family: "微软雅黑", "宋体";
}
.logo {
background-color: #f0eff4;
height: 90rpx;
line-height: 88rpx;
display: flex;
justify-content: space-between;
padding: 0 20rpx;
color: #fff;
font-size: 40rpx;
}
.logo image {
width: 90rpx;
height: 90rpx;
}
.logo .input {
width: 710rpx;
height: 50rpx;
border: 0;
border-radius: 10rpx;
background-color: #fff;
color: #999;
text-align: center;
margin-top: 20rpx;
}
.head {
display: flex;
justify-content: space-between;
text-align: center;
line-height: 100rpx;
font-size: 32rpx;
background-color: #fff;
}
.head view {
flex: 1;
}
.head navigator {
display: inline-block;
line-height: 100rpx;
}
.head navigator.on {
border-bottom: 1px solid #363636;
}
.modular {
background-color: #fff;
padding: 20rpx 0 0;
margin-top: 20rpx;
}
.modular .h1 {
font-size: 40rpx;
line-height: 90rpx;
}
.modular .h1 .span {
border-left: 10rpx solid #cda663;
padding-left: 10rpx;
display: inline;
}
.modular .content {
column-count: 4;
column-gap: 32rpx;
border-bottom: 2rpx solid #f1f1f1;
overflow: hidden;
padding: 0 20rpx;
}
.modular .content image {
width: 100%;
height: 190rpx;
}
.modular .content view {
padding: 14rpx 0;
line-height: 34rpx;
font-size: 28rpx;
text-align: center;
}
.modular .more {
line-height: 90rpx;
text-align: center;
color: #727ba6;
font-size: 32rpx;
}
.modular .more .next {
height: 16rpx;
display: inline-block;
width: 16rpx;
border-right: 6rpx solid #c9c8cd;
border-bottom: 6rpx solid #c9c8cd;
transform: rotate(-45deg);
margin-top: 6rpx;
}
/* 收货地址的全部配置 */
.citypickers{
position: fixed;
height: 100%;
width: 100%;
min-height: 100%;
background-color: red;
}
.citybody {
position: fixed;
bottom: 0px;
}
.cityheader {
position: absolute;
top:0px;
width: 100%;
z-index: 4;
}
.city-cancel {
float: left;
margin: 20rpx;
color: #818181;
}
.city-true {
float: right;
margin: 20rpx;
color: #2FB42E
}
.section .picker {
background-color: #fff;
border-bottom: 1px #d9d9d9 solid;
border-top: 1px #d9d9d9 solid;
padding: 20rpx;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

@ -0,0 +1,66 @@
var bmap = require('../../utils/bmap-wx.min.js');
var wxMarkerData = [],
originalData;
Page({
data: {
markers: [],
latitude: '',
longitude: '',
school: '',
rgcData: {}
},
makertap: function(e) {
var that = this;
var id = e.markerId;
that.showSearchInfo(wxMarkerData, id);
},
onLoad: function() {
var that = this;
var BMap = new bmap.BMapWX({
ak: 'zuwiVmIUj822mmW6psamM888QLz8Q5wF'
});
var fail = function(data) {
console.log(data)
};
var success = function(data) {
var school = '11';
originalData = data.originalData;
wxMarkerData = data.wxMarkerData;
that.setData({
// markers是一个在data中定义的数据用来存储百度地图获取的数据
markers: wxMarkerData
});
that.setData({
// 经度
latitude: wxMarkerData[0].latitude
});
that.setData({
// 纬度
longitude: wxMarkerData[0].longitude
});
that.setData({
// 获取当前位置的大学名称
school: originalData.result.poiRegions[0].name,
});
}
BMap.regeocoding({
"query": '湖北',//在湖北地区进行搜索
fail: fail,
success: success,
iconPath: '../../images/map/marker_red.png',
iconTapPath: '../../images/map/marker_red.png'
});
},
showSearchInfo: function(data, i) {
var that = this;
that.setData({
rgcData: {
address: '地址:' + data[i].address + '\n',
desc: '描述:' + data[i].desc + '\n',
business: '商圈:' + data[i].business
}
});
}
})

@ -0,0 +1,9 @@
<view class="map_container">
<map class="map" id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="14" show-location="true" markers="{{markers}}" bindmarkertap="makertap"></map>
</view>
<view class="rgc_info">
<text>{{rgcData.address}}</text>
<text>{{rgcData.desc}}</text>
<text>{{rgcData.business}}</text>
</view>
<view>{{school}}</view>

@ -0,0 +1,13 @@
.map_container{
height: 450px;
width: 100%;
}
.map {
height: 100%;
width: 100%;
}
.rgc_info {
padding: 0 5px;
}

@ -0,0 +1,79 @@
var bmap = require('../../utils/bmap-wx.min.js');
var wxMarkerData = [];
var searchData = {};
Page({
data: {
markers: [],
latitude: '',
longitude: '',
placeData: {}
},
makertap: function(e) {
var that = this;
var id = e.markerId;
that.showSearchInfo(wxMarkerData, id);
that.changeMarkerColor(wxMarkerData, id);
},
onLoad: function() {
var that = this;
var BMap = new bmap.BMapWX({
ak: 'zuwiVmIUj822mmW6psamM888QLz8Q5wF'
});
var fail = function(data) {
console.log(data)
};
var success = function(data) {
wxMarkerData = data.wxMarkerData;
that.setData({
markers: wxMarkerData
});
that.setData({
latitude: wxMarkerData[0].latitude
});
that.setData({
longitude: wxMarkerData[0].longitude
});
}
BMap.search({
"query": '大学学院',
fail: fail,
success: success,
iconPath: '../../images/map/marker_red.png',
iconTapPath: '../../images/map/marker_red.png'
});
},
onReady: function(){
// 当页面首次渲染完成后触发的函数
var that = this;
searchData = that.data;
console.log(searchData);
},
showSearchInfo: function(data, i) {
console.log(data)
var that = this;
that.setData({
placeData: {
title: '名称:' + data[i].title + '\n',
address: '地址:' + data[i].address + '\n',
telephone: '电话:' + data[i].telephone
}
});
},
changeMarkerColor: function(data, id) {
var that = this;
var markersTemp = [];
for (var i = 0; i < data.length; i++) {
if (i === id) {
data[i].iconPath = "../../images/map/marker_yellow.png";
} else {
data[i].iconPath = "../../images/map/marker_red.png";
}
markersTemp[i] = data[i];
}
that.setData({
markers: markersTemp
});
},
})

@ -0,0 +1,9 @@
<view class="map_container">
<map class="map" id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="14" show-location="true" markers="{{markers}}" bindmarkertap="makertap"></map>
</view>
<view class="place_info">
<text>{{placeData.title}}</text>
<text>{{placeData.address}}</text>
<text>{{placeData.telephone}}</text>
</view>

@ -0,0 +1,13 @@
.map_container{
height: 450px;
width: 100%;
}
.map {
height: 100%;
width: 100%;
}
.place_info {
padding: 0 5px;
}

@ -0,0 +1,38 @@
var bmap = require('../../utils/bmap-wx.min.js');
Page({
data: {
sugData: ''
},
bindKeyInput: function(e) {
var that = this;
if (e.detail.value === '') {
that.setData({
sugData: ''
});
return;
}
var BMap = new bmap.BMapWX({
ak: 'zuwiVmIUj822mmW6psamM888QLz8Q5wF'
});
var fail = function(data) {
console.log(data)
};
var success = function(data) {
var sugData = '';
for(var i = 0; i < data.result.length; i++) {
sugData = sugData + data.result[i].name + '\n';
}
that.setData({
sugData: sugData
});
}
BMap.suggestion({
query: e.detail.value,
region: '湖北',
city_limit: true,
fail: fail,
success: success
});
}
})

@ -0,0 +1,6 @@
<view class="section">
<input placeholder="输入关键字" type="text" bindinput="bindKeyInput"/>
</view>
<view class="sug_info">
<text>{{sugData}}</text>
</view>

@ -0,0 +1,12 @@
page {
background-color: #ccc;
}
input {
margin: 10px 10px;
background-color: #fff;
}
.sug_info {
margin: 15px 10px;
}

@ -0,0 +1,56 @@
var bmap = require('../../utils/bmap-wx.min.js');
var timestamp = Date.parse(new Date());
var hover = new Date(timestamp).getHours();
Page({
data: {
weatherData: '',
weather_data: [],
weatherUrl : ''
},
onLoad: function() {
var that = this;
var BMap = new bmap.BMapWX({
ak: 'zuwiVmIUj822mmW6psamM888QLz8Q5wF'
});
var fail = function(data) {
console.log('fail!!!!')
};
var success = function(data) {
var weatherData = data.currentWeather[0];
var weather_data = data.originalData.results[0].weather_data;
console.log(weather_data);
weatherData = '城市:' + weatherData.currentCity + '\n' + 'PM2.5' + weatherData.pm25 + '\n' +'日期:' + weatherData.date + '\n' + '温度:' + weatherData.temperature + '\n' +'天气:' + weatherData.weatherDesc + '\n' +'风力:' + weatherData.wind + '\n';
that.setData({
weatherData: weatherData,
weather_data: weather_data
});
if (hover > 6 && hover < 18) {
console.log(hover);
console.log(that.data.weather_data[0].dayPictureUrl);
that.setData({
weatherUrl: that.data.weather_data[0].dayPictureUrl
})
} else {
console.log(hover);
that.setData({
weatherUrl: that.data.weather_data[0].nightPictureUrl
})
}
}
BMap.weather({
fail: fail,
success: success
});
},
onReady: function(){
}
})

@ -0,0 +1,10 @@
<view class="weather">
<!-- <image src='{{weatherUrl}}' style='width:40rpx;height:40rpx'></image> -->
<text>{{weatherData}}</text>
<view wx:for="{{weather_data}}" wx:key="{{weather_data}}" wx:for-index="index" wx:for-item="item">
<text>{{item.date}} : </text>
<image src='{{item.dayPictureUrl}}' style='width:40rpx;height:40rpx'></image>
<image src='{{item.nightPictureUrl}}' style='width:40rpx;height:40rpx'></image>
</view>
</view>

@ -0,0 +1,13 @@
.weather{
width: 100%;
text-align: center;
line-height: 40px;
padding-top: 150px;
color: #fff;
font-weight: 600;
height: 100%;
}
page {
background-color: #27AE60;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,140 @@
// pages/classify/job/job.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
jobMessage: {}, //兼职信息
jobId: '',
jobLength: '5',
isJobShow: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var id = options.id;
this.getMovieListData();
},
getMovieListData: function () {
var that = this;
var isJobShow = that.data.isJobShow;
var jobMessage = 'jobMessage';
var jobId = that.data.jobId;
var jobLength = that.data.jobLength;
var url = app.globalData.huanbaoBase + 'refreshjobs.php';
if(jobLength < 5){
that.setData({
isJobShow: true
})
return
}
wx.showToast({
title: '加载中',
icon: 'loading',
duration: 2000,
})
wx.request({
url,
method: 'POST',
header: { 'content-type': 'application/x-www-form-urlencoded ' },
data: {
lastId: jobId
},
success: res => {
var messages = that.data.jobMessage.messages || [];
var data = res.data.data;
that.setData({
jobLength: data.length //每次获取5组值
})
data.forEach(item => {
messages.push(item);
})
console.log(messages);
that.setData({
[jobMessage]: {messages},
jobId: res.data.data[4].jobid
})
},
fail: err => {
console.log(err);
}
})
},
toDetail(e) {
var that = this;
var id = e.currentTarget.dataset.id;
console.log(id);
wx.navigateTo({
url: '../jobDetail/jobDetail?id=' + id
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
wx.setNavigationBarTitle({
title: '校园兼职'
});
wx.showNavigationBarLoading(); //在标题栏中显示加载图标
setTimeout(function () {
wx.stopPullDownRefresh(); //停止加载
wx.hideNavigationBarLoading(); //隐藏加载icon
}, 2000)
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.getMovieListData();
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
loadMore: function () {
console.log(1);
},
})

@ -0,0 +1,3 @@
{
"navigationBarTitleText": "校园兼职"
}

@ -0,0 +1,22 @@
<!--pages/classify/job/job.wxml-->
<view class='job-wrapper'>
<view class='job-tip'>温馨提示:平台兼职信息为本校学生所发,信息真实性请与发布者核实后报名,凡收取费用的兼职请谨慎报名,以防被骗</view>
<view class='job-school'>湖北科技学院学生兼职</view>
<scroll-view scroll-y class='scroll-job' bindscrolltolower="loadMore">
<block wx:for="{{jobMessage.messages}}" wx:key="{{jobMessage.messages}}">
<view class='job-box' bindtap='toDetail' data-id='{{item.jobid}}'>
<view class='job-top'>
<text class="job-title">{{item.title}}</text>
<text class="job-jianzhi">兼职</text>
</view>
<text class='job-place'>{{item.workplace}}</text>
<text class='job-time'>{{item.worktime}}</text>
<text class='job-require'>{{item.workrequirement}}</text>
<text class='job-treat'>{{item.workpay}}</text>
</view>
</block>
<view wx:if="{{isJobShow}}" class='bottom'>到底了,没有了</view>
</scroll-view>
</view>

@ -0,0 +1,63 @@
/* pages/classify/job/job.wxss */
.job-wrapper {
background-color: #fff;
}
.job-tip{
padding: 10rpx 20rpx;
color: red;
font-size: 28rpx;
background-color: #e6e6e6;
}
.job-school {
display: inline-block;
padding: 30rpx 40rpx;
color: #444;
font-size: 36rpx;
}
.job-box {
display: flex;
flex-direction: column;
border-top-width: 1rpx;
border-top-style: solid;
border-top-color: #f3f3f3;
padding: 30rpx 40rpx;
}
.job-title {
font-weight: 400;
font-size: 36rpx;
}
.job-jianzhi {
display: inline-block;
background-color: #37A88D;
border-radius: 10rpx;
color: #fff;
padding: 5rpx 10rpx;
margin-left: 20rpx;
font-size: 32rpx;
}
.job-place {
color: #666;
font-size: 32rpx;
}
.job-time {
color: #666;
font-size: 32rpx;
}
.job-require {
color: #666;
font-size: 32rpx;
}
.job-treat {
font-size: 36rpx;
color: #f40;
}
.bottom {
font-size: 28rpx;
color: #e9e9e9;
text-align: center;
background-color: #666;
}

@ -0,0 +1,124 @@
// pages/classify/jobDetail/jobDetail.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
jobTitle: '', //兼职名字
jobTreat: '', //兼职待遇
jobTime: '', //兼职时间
jobPlace: '', //兼职地点
jobRequire: '', //兼职要求
jobDiscripe: '', //兼职描述
jobPoster: '', //兼职发布者
jobContactWay: '', //兼职联系方式
jobId: '', //兼职id
studentId: '', //学生id
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var that = this;
wx.showToast({
title: '加载中',
icon: 'loading',
duration: 2000
});
var jobTitle = that.data.jobTitle;
var jobTreat = that.data.jobTreat;
var jobTime = that.data.jobTime;
var jobPlace = that.data.jobPlace;
var jobRequire = that.data.jobRequire;
var jobDiscripe = that.data.jobDiscripe;
var jobPoster = that.data.jobPoster;
var jobContactWay = that.data.jobContactWay;
var jobId = that.data.jobId;
var url = app.globalData.huanbaoBase + 'getbyjobid.php';
wx.request({
url,
method: 'POST',
header: { 'content-type': 'application/x-www-form-urlencoded ' },
data: {
jobId: options.id,
},
success: function (res) {
var data = res.data.data[0];
console.log(data);
that.setData({
jobTitle: data.title,
jobTreat: data.workpay,
jobTime: data.worktime,
jobPlace: data.workplace,
jobRequire: data.workrequirement,
jobDiscripe: data.discription,
jobPoster: data.username,
jobContactWay: data.workcontact,
})
} //此处的res就是data对象
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
wx.setNavigationBarTitle({
title: '兼职详情'
});
wx.showNavigationBarLoading(); //在标题栏中显示加载图标
setTimeout(function () {
wx.stopPullDownRefresh(); //停止加载
wx.hideNavigationBarLoading(); //隐藏加载icon
}, 2000)
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

@ -0,0 +1,5 @@
{
"navigationBarTitleText": "兼职详情",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
}

@ -0,0 +1,18 @@
<!--pages/classify/jobDetail/jobDetail.wxml-->
<view class='job-wrapper'>
<view class='job-title'>
<view class='title'> {{jobTitle}}</view>
<view class='jianzhi'>兼职</view>
<view class='jiesuan'>{{jobTreat}}</view>
</view>
<view class='job-school'>本职位由本校学生提供</view>
<view class='job-detail'>
<view>工作时间:{{jobTime}}</view>
<view>工作地点:{{jobPlace}}</view>
<view>人员要求:{{jobRequire}}</view>
<view>详情描述:{{jobDiscripe}}</view>
<view>发布者:{{jobPoster}}</view>
<view>联系方式:{{jobContactWay}}</view>
</view>
</view>

@ -0,0 +1,56 @@
/* pages/classify/jobDetail/jobDetail.wxss */
.job-wrapper {
background-color: #F5F5F7;
margin-bottom: 100rpx;
}
.job-title {
border-top-width: 1rpx;
border-top-color: #F5F5F7;
border-top-style: solid;
padding: 30rpx 40rpx;
background-color: #fff;
}
.title {
display: inline-block;
font-size: 46rpx;
background-color: #fff;
}
.jiesuan {
margin-top: 10rpx;
font-size: 30rpx;
color: #f40;
padding: 5rpx 10rpx;
background-color: #fff;
}
.jianzhi {
display: inline-block;
background-color: #37A88D;
border-radius: 10rpx;
color: #fff;
padding: 5rpx 10rpx;
margin-left: 40rpx;
font-size: 32rpx;
}
.job-school {
width: 100%;
height: 50rpx;
padding: 20rpx 40rpx;
border-top-width: 1rpx;
border-top-color: #F5F5F7;
border-top-style: solid;
background-color: #fff;
font-size: 32rpx;
}
.job-detail{
margin-top: 20rpx;
}
.job-detail view{
font-size: 30rpx;
color: #666;
padding: 20rpx 40rpx;
border-top-width: 1rpx;
border-top-color: #F5F5F7;
border-top-style: solid;
background-color: #fff;
}

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

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

@ -0,0 +1 @@
/* pages/classify/sale/sale.wxss */

@ -0,0 +1,139 @@
// pages/search/search.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
// 存放数据
resultList: [],
keyWord: '',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
wx.setNavigationBarTitle({
title: '搜索物品'
});
wx.showNavigationBarLoading(); //在标题栏中显示加载图标
setTimeout(function () {
wx.stopPullDownRefresh(); //停止加载
wx.hideNavigationBarLoading(); //隐藏加载icon
}, 2000)
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
bindToSearch(e) {
var that = this;
var keyWord = that.data.keyWord;
console.log(1);
console.log(keyWord);
wx.navigateTo({
url: '../../search-thing-result/search-thing-result?keyWord=' + keyWord
})
},
searchBook(e) {
var that = this;
var keyWord = that.data.keyWord;
var value = e.detail.value; //input输入的值
console.log(value);
that.setData({
keyWord: value
})
var url = app.globalData.huanbaoBase + 'searchthing.php';
//微信请求方式的写法
wx.request({
url,
method: 'POST',
data: {
keyword: value
},
header: { 'content-type': 'application/x-www-form-urlencoded ' },
success(res) {
console.log(res);
that.handleData(res.data.data);
},
fail(err) {
console.log(err);
}
})
},
handleData(data) {
console.log(data);
var resultList = []
data.forEach(item => {
//注意: push可以是具体的对象
// resultList.push({
// title: item.title,
// image: item.images.small,
// desc,
// id: item.id
// })
resultList.push(item)
})
this.setData({ resultList: resultList });//将此处resultList的值放在数据data的resultList中
},
bindToSearchList(e) {
console.log(e.currentTarget.dataset.value);
var that = this;
var value = e.currentTarget.dataset.value;
var keyWord = value;
wx.navigateTo({
url: '../../search-thing-result/search-thing-result?keyWord=' + keyWord
})
}
})

@ -0,0 +1,3 @@
{
"navigationBarTitleText": "搜索物品"
}

@ -0,0 +1,18 @@
<view class='search'>
<view class='search-book'>
<icon type='search' size='16' class='search-icon'></icon>
<input class='search-input' placeholder='物品搜索' bindinput='searchBook'></input>
<text class='search-search' data-keyWord='{{keyWord}}' bindtap='bindToSearch'>搜索</text>
</view>
<view class='search-list'>
<block wx:for="{{resultList}}" wx:key="result">
<view class='book-wrapper' >
<view class='book-content' data-value='{{item}}' bindtap='bindToSearchList'>{{item}}</view>
</view>
</block>
</view>
</view>

@ -0,0 +1,59 @@
/* pages/search-book/search-book.wxss */
.search {
background-color: #fff;
}
.search-book {
display: flex;
padding: 20rpx 30rpx;
align-items: center;
background: #fff;
border-width: 2rpx 0rpx;
border-style: solid;
border-color: #888;
margin-bottom: 30rpx;
}
.search-icon {
margin-right: 30rpx;
}
.search-placeholder {
color:#d8d8d8;
}
.search-input {
flex: 1;
color: #4a4a4a;
font-size: 32rpx;
}
.search-search {
width: 80rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
font-size: 32rpx;
background-color: #FF7B00;
color: #fff;
border-radius: 20rpx;
}
.book-wrapper {
padding: 0 30rpx;
border-bottom: 1px solid #F8F8F8;
box-sizing: border-box;
background-color: #fff;
}
.book-content {
display: flex;
flex-direction: row;
align-items: stretch;
margin: 16rpx 0;
color: #626667;
font-size: 30rpx;
padding: 15rpx 0rpx;
}
.book-content::after {
position: absolute;
right: 40rpx;
content: ">";
font-size: 40rpx;
color: #ccc;
}

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

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

@ -0,0 +1 @@
/* pages/classify/welfare/welfare.wxss */

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

@ -0,0 +1,21 @@
<!--pages/movie-grid/movie-grid.wxml-->
<template name="movie-grid">
<view class='movie-wrapper' data-id='{{bookid}}'bindtap='toDetail' data-id='{{bookid}}'>
<view class='movie-content'>
<image class='poster' src='{{picture}}'></image>
<text class='name'>{{bname}}</text>
<text class='wish-count'>¥{{bprice}}</text>
</view>
</view>
</template>
<template name="movie-grid2">
<view class='movie-wrapper' data-id='{{goodid}}'bindtap='toThingsDetail' data-id='{{goodid}}'>
<view class='movie-content'>
<image class='poster' src='{{gpicture}}'></image>
<text class='name'>{{gname}}</text>
<text class='wish-count'>¥{{gprice}}</text>
</view>
</view>
</template>

@ -0,0 +1,28 @@
/* pages/movie-grid/movie-grid.wxss */
.movie-wrapper {
display: inline-block;
margin: 0 10rpx;
}
.movie-content {
display: flex;
flex-direction: column;
align-items: center;
}
/* 图片的类poster */
.poster {
width: 185rpx;
height: 220rpx;
}
.name {
width: 200rpx;
color: #4a4a4a;
font-weight: 500;
font-size: 28rpx;
text-align: center;
white-space: ellipsis;
overflow: hidden;
}
.wish-count {
color: #f40;
font-size: 36rpx;
}

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

@ -0,0 +1,16 @@
<!--pages/components/news/news.wxml-->
<template name="theNews">
<swiper class="swiper_container" vertical="true" autoplay="true" circular="true" interval="2000">
<block wx:for="{{msgList}}" wx:key="{{imgUrls}}">
<navigator url="/pages/sonShouye/headline/headline?title={{item.url}}" open-type="navigate">
<swiper-item>
<view class="swiper_item">{{item.title}}</view>
</swiper-item>
</navigator>
</block>
</swiper>
</template>

@ -0,0 +1,17 @@
/* pages/components/news/news.wxss */
.swiper_container {
color: #E1B47C;
background-color: #F3F3F3;
height: 60rpx;
width: 100%;
line-height: 40rpx;
}
.swiper_item {
text-indent: 1rem;
font-size: 30rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

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

@ -0,0 +1,37 @@
<!--pages/components/recommend/recommend.wxml-->
<import src="../movie-grid/movie-grid.wxml"/>
<template name= "recommend">
<view class='cont'>
<view class='session-page'>
<view class='session-header'>
<text class='header-title'>推荐好书</text>
<text class='header-more' bindtap='bindToMore' data-type-id='inThearters'>更多></text>
</view>
<view class='session-content'>
<scroll-view scroll-x="ture" class='movie-scroll'>
<block wx:for="{{inThearters}}" wx:key="{{inThearters}}">
<template is="movie-grid" data="{{...item}}"></template>
<!-- 此处的item就是指inTheater因为遍历每一项 -->
</block>
</scroll-view>
</view>
</view>
<view class='session-page'>
<view class='session-header'>
<text class='header-title'>推荐好物</text>
<text class='header-more' bindtap='bindToMore' data-type-id='comingSoon'>更多></text>
</view>
<view class='session-content'>
<scroll-view scroll-x="ture" class='movie-scroll'>
<block wx:for="{{comingSoon}}" wx:key="{{comingSoon}}">
<template is="movie-grid2" data="{{...item}}"></template>
<!-- 此处的item就是指inTheater因为遍历每一项 -->
</block>
</scroll-view>
</view>
</view>
</view>
</template>

@ -0,0 +1,40 @@
/* pages/components/recommend/recommend.wxss */
@import '../movie-grid/movie-grid.wxss';
.cont {
margin-top: 80rpx;
}
.session-page {
background-color: #fff;
border-width: 2rpx 0;
border-color: #e6e6e6;
border-style: solid;
padding-bottom: 10rpx;
margin-bottom: 10rpx;
}
.session-header {
padding: 10rpx 20rpx;
display: flex;
align-items: center;
}
.header-title {
color: #4a4a4a;
flex: 1;
font-weight: 400;
font-size: 36rpx;
}
.header-more {
color: #32cd32;
}
.session-content {
width: 100%;
white-space: nowrap;
padding: 0 30rpx;
box-sizing: border-box;
margin-top: 10rpx;
}
.movie-scroll {
white-space: nowrap;
width: 100%;
}

@ -0,0 +1,89 @@
// 这是个模板此处的js代码是无效的在调用该模板的文件js中有以下代码
//并且这里有代码错误系统也会报错
var bmap = require('../../../utils/bmap-wx.min.js');
var wxMarkerData = [];
var searchData = {};
Page({
data: {
markers: [],
latitude: '',
longitude: '',
placeData: {}
},
makertap: function (e) {
var that = this;
var id = e.markerId;
that.showSearchInfo(wxMarkerData, id);
that.changeMarkerColor(wxMarkerData, id);
},
onLoad: function () {
// canvas
const ctx = wx.createCanvasContext('myCanvas')
ctx.setFillStyle('red')
ctx.fillRect(0, 0, 10, 5)
ctx.draw()
// 位置信息
var that = this;
var BMap = new bmap.BMapWX({
ak: 'zuwiVmIUj822mmW6psamM888QLz8Q5wF'
});
var fail = function (data) {
console.log(data)
};
var success = function (data) {
wxMarkerData = data.wxMarkerData;
that.setData({
markers: wxMarkerData
});
that.setData({
latitude: wxMarkerData[0].latitude
});
that.setData({
longitude: wxMarkerData[0].longitude
});
}
BMap.search({
"query": '大学学院',
fail: fail,
success: success,
iconPath: '../../images/map/marker_red.png',
iconTapPath: '../../images/map/marker_red.png'
});
},
onReady: function () {
var that = this;
searchData = that.data;
console.log(searchData);
},
showSearchInfo: function (data, i) {
console.log(data)
var that = this;
that.setData({
placeData: {
title: '名称:' + data[i].title + '\n',
address: '地址:' + data[i].address + '\n',
telephone: '电话:' + data[i].telephone
}
});
},
changeMarkerColor: function (data, id) {
var that = this;
var markersTemp = [];
for (var i = 0; i < data.length; i++) {
if (i === id) {
data[i].iconPath = "../../images/map/marker_yellow.png";
} else {
data[i].iconPath = "../../images/map/marker_red.png";
}
markersTemp[i] = data[i];
}
that.setData({
markers: markersTemp
});
},
})

@ -0,0 +1,18 @@
<!--pages/components/weatherLocationTrand/weatherLocationTrand.wxml-->
<template name="search">
<view class="place_info">
<!-- 此处URL是以调用者的位置来找文件的 -->
<!-- 链接的位置太远,也是没有效果的,既不报错,也没有跳转,比如:../../mapWeather/search/search -->
<navigator url="../search/search" class='location'>
<view class='school'>
<text>{{search.schoolPlace || search.placeData.title}}</text>
</view>
<canvas canvas-id="myCanvas" class='myCanvas' />
</navigator>
</view>
<!-- <view class="map_container">
<map class="map" id="map" longitude="{{search.longitude}}" latitude="{{search.latitude}}" scale="14" show-location="true" markers="{{search.markers}}" bindmarkertap="makertap"></map>
</view> -->
</template>

@ -0,0 +1,31 @@
/* pages/components/weatherLocationTrand/weatherLocationTrand.wxss */
.place_info {
width: 100%;
height: 70rpx;
background-color: #f3f3f3;
padding: 0 5px;
border-bottom: 1rpx solid rgba(153, 153, 153, 0.5);
}
.location {
width: 220rpx;
height: 70rpx;
}
.school {
width: 190rpx;
height: 100%;
line-height: 70rpx;
color: #3E97CC;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.myCanvas {
position: absolute;
top: 12rpx;
left: 180rpx;
width: 70rpx;
height: 70rpx;
}

@ -0,0 +1,118 @@
//index.js
//获取应用实例
var tcity = require("../../utils/citys.js");
var app = getApp()
Page({
data: {
provinces: [],
province: "",
citys: [],
city: "",
countys: [],
county: '',
value: [0, 0, 0],
values: [0, 0, 0],
condition: false
},
bindChange: function(e) {
//console.log(e);
var val = e.detail.value
var t = this.data.values;
var cityData = this.data.cityData;
if(val[0] != t[0]){
console.log('province no ');
const citys = [];
const countys = [];
for (let i = 0 ; i < cityData[val[0]].sub.length; i++) {
citys.push(cityData[val[0]].sub[i].name)
}
for (let i = 0 ; i < cityData[val[0]].sub[0].sub.length; i++) {
countys.push(cityData[val[0]].sub[0].sub[i].name)
}
this.setData({
province: this.data.provinces[val[0]],
city: cityData[val[0]].sub[0].name,
citys:citys,
county: cityData[val[0]].sub[0].sub[0].name,
countys:countys,
values: val,
value:[val[0],0,0]
})
return;
}
if(val[1] != t[1]){
console.log('city no');
const countys = [];
for (let i = 0 ; i < cityData[val[0]].sub[val[1]].sub.length; i++) {
countys.push(cityData[val[0]].sub[val[1]].sub[i].name)
}
this.setData({
city: this.data.citys[val[1]],
county: cityData[val[0]].sub[val[1]].sub[0].name,
countys:countys,
values: val,
value:[val[0],val[1],0]
})
return;
}
if(val[2] != t[2]){
console.log('county no');
this.setData({
county: this.data.countys[val[2]],
values: val
})
return;
}
},
open:function(){
this.setData({
condition:!this.data.condition
})
},
onLoad: function () {
console.log("onLoad");
var that = this;
tcity.init(that);
var cityData = that.data.cityData;
const provinces = [];
const citys = [];
const countys = [];
for(let i=0;i<cityData.length;i++){
provinces.push(cityData[i].name);
}
console.log('省份完成');
for (let i = 0 ; i < cityData[0].sub.length; i++) {
citys.push(cityData[0].sub[i].name)
}
console.log('city完成');
for (let i = 0 ; i < cityData[0].sub[0].sub.length; i++) {
countys.push(cityData[0].sub[0].sub[i].name)
}
that.setData({
'provinces': provinces,
'citys':citys,
'countys':countys,
'province':cityData[0].name,
'city':cityData[0].sub[0].name,
'county':cityData[0].sub[0].sub[0].name
})
console.log('初始化完成');
}
})

@ -0,0 +1,26 @@
<!--index.wxml-->
<view class="container">
<view class="input">
<input placeholder="选择" value="{{province}}-{{city}}-{{county}}" focus="{{focus}}" bindfocus="open" />
</view>
</view>
<view wx:if="{{condition}}" class="citypicker">
<picker-view indicator-style="height: 50px;" style="width: 100%; height: 300px;" value="{{value}}" bindchange="bindChange" class="citybody">
<view class="cityheader">
<view bindtap="open" class="city-cancel">取消</view>
<view bindtap="open" class="city-true">确定</view>
</view>
<picker-view-column>
<view wx:for="{{provinces}}" wx:key="item" style="line-height: 50px;padding-left:10px;" >{{item}}</view>
</picker-view-column>
<picker-view-column>
<view wx:for="{{citys}}" wx:key="item" style="line-height: 50px;padding-left:10px;">{{item}}</view>
</picker-view-column>
<picker-view-column>
<view wx:for="{{countys}}" wx:key="item" style="line-height: 50px;padding-left:10px;">{{item}}</view>
</picker-view-column>
</picker-view>
</view>

@ -0,0 +1,32 @@
/**index.wxss**/
.input {
padding-top: 300rpx;
width: 100%;
}
.input input {
width: 100%;
background-color: #fff;
border-bottom: 1px #d9d9d9 solid;
border-top: 1px #d9d9d9 solid;
padding: 20rpx 50rpx;
}
.section {
padding-top: 20rpx;
}
.userinfo-avatar {
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
}
.userinfo-nickname {
color: #aaa;
}
.usermotto {
margin-top: 200px;
}

@ -0,0 +1,35 @@
const APP_ID = ''; //输入小程序appid
const APP_SECRET = ''; //输入小程序app_secret
var OPEN_ID = '' //储存获取到openid
var SESSION_KEY = '' //储存获取到session_key
Page({
getOpenIdTap: function() {
var that = this;
wx.login({
success: function(res) {
wx.request({
//获取openid接口
url: 'https://api.weixin.qq.com/sns/jscode2session',
data: {
appid: APP_ID,
secret: APP_SECRET,
js_code: res.code,
grant_type: 'authorization_code'
},
method: 'GET',
success: function(res) {
console.log(res.data)
OPEN_ID = res.data.openid; //获取到的openid
SESSION_KEY = res.data.session_key; //获取到session_key
console.log(OPEN_ID.length)
console.log(SESSION_KEY.length)
that.setData({
openid: res.data.openid.substr(0, 10) + '********' + res.data.openid.substr(res.data.openid.length - 8, res.data.openid.length),
session_key: res.data.session_key.substr(0, 8) + '********' + res.data.session_key.substr(res.data.session_key.length - 6, res.data.session_key.length)
})
}
})
}
})
}
})

@ -0,0 +1,3 @@
{
"navigationBarTitleText": "查看启动日志"
}

@ -0,0 +1,3 @@
<!--logs.wxml-->
<button wx:if="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">授权登录</button>
<view wx:else>请升级微信版本</view>

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -0,0 +1,343 @@
// pages/movie-detail/movie-detail.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
detailData: {
url: '',
bookName: '', //书名
bookAuthor: '',//作者
bookPress: '',//出版社
isTextbook: false,//是否资料书
conditions: '',//
campus: '',// 校区
price: '', //价格
remark: '', //备注,详情
poster: '', //发布者
},
hadAddCart: false , //已经加入购物车
studentId: '',
bookId: '',
theCover: false,
thePay: false,
nickName: '',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options.id); //接收上一个页面传过来的数据,是个对象。
wx.showToast({
title: '加载中',
icon: 'loading',
duration: 2000
});
var that = this;
var detailData = that.data.detailData;
var theUrl = 'detailData.url';
var bookName = 'detailData.bookName';
var bookAuthor = 'detailData.bookAuthor';
var bookPress = 'detailData.bookPress';
var isTextbook = 'detailData.isTextbook';
var conditions = 'detailData.conditions';
var campus = 'detailData.campus';
var price = 'detailData.price';
var remark = 'detailData.remark';
var poster = 'detailData.poster';
var studentId = that.data.studentId; //学生id
var bookId = that.data.bookId; //书本id
var nickName = that.data.nickName;
var url = app.globalData.huanbaoBase + 'getbybookid.php';
try {
var value = wx.getStorageSync('studentIdSync')
if (value) {
console.log(value); //同步得到studentId的值
that.setData({
studentId: value
})
}
} catch (e) {
console.log(0);
}
try {
var value = wx.getStorageSync('nickName')
if (value) {
that.setData({
[nickName]: value
})
}
} catch (e) {
// Do something when catch error
}
console.log(studentId);//此处是获取不到值的
wx.request({
url,
method: 'POST',
// header: {'content-type' : 'json'},
header: { 'content-type': 'application/x-www-form-urlencoded '},
data: {
bookId: options.id,
},
success: function(res){
var data = res.data.data[0];
that.setData({
[theUrl]: data.picture,
[bookName]: data.bname,
[isTextbook]: data.reference,
[remark]: data.bnote || '无描述',
[price]: data.bprice,
[bookAuthor]: data.author,
[bookPress]: data.press,
[poster]: data.usersname,
[campus]: data.college,
[conditions]: data.bstatus,
bookId: options.id
})
} //此处的res就是data对象
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
var that = this;
var studentId = that.data.studentId; //学生id
var nickName = that.data.nickName;
try {
var value = wx.getStorageSync('studentIdSync')
if (value) {
console.log(value); //同步得到studentId的值
that.setData({
studentId: value
})
}
} catch (e) {
console.log(0);
}
console.log(studentId);
try {
var value = wx.getStorageSync('nickName')
if (value) {
that.setData({
nickName: value
})
}
} catch (e) {
// Do something when catch error
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
wx.setNavigationBarTitle({
title: '书本详情'
});
wx.showNavigationBarLoading(); //在标题栏中显示加载图标
setTimeout(function () {
wx.stopPullDownRefresh(); //停止加载
wx.hideNavigationBarLoading(); //隐藏加载icon
}, 2000)
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
addMyCart(){
var that = this;
var hadAddCart = that.data.hadAddCart;
var studentId = that.data.studentId;
var bookId = that.data.bookId;
var url = app.globalData.huanbaoBase + 'bookcar.php'
console.log(bookId);
if(studentId){
console.log(studentId);
if (!hadAddCart) {
wx.showModal({
title: '提示',
content: '是否加入购物车',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
wx.request({
url, //仅为示例,并非真实的接口地址
method: 'POST',
data: {
studentId: studentId,
bookId: bookId,
},
header: {
'content-type': 'application/x-www-form-urlencoded' // 默认值
},
success: function (res) {
that.setData({
hadAddCart: true
})
wx.showToast({
title: '成功',
icon: 'success',
duration: 1000
})
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
} else {
wx.showModal({
title: '提示',
content: '请勿重复添加',
})
}
}else {
wx.showModal({
title: '提示',
content: '请认证您的身份',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
wx.navigateTo({
url: '../my/mySetting/mySetting',
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
}
},
nowBuy() {
var that = this;
var bookId = this.data.bookId;
var theCover = that.data.theCover;
var thePay = that.data.thePay;
that.setData({
theCover: true,
thePay: true,
})
},
deletePay() {
var that = this;
var theCover = that.data.theCover;
var thePay = that.data.thePay;
that.setData({
theCover: false,
thePay: false,
})
},
buy() {
var that = this;
var bookId = this.data.bookId;
var url = app.globalData.huanbaoBase + 'tempbooks.php';
wx.request({
url, //仅为示例,并非真实的接口地址
method: 'POST',
data: {
bookId: bookId
},
header: {
'content-type': 'application/x-www-form-urlencoded' // 默认值
},
success: function (res) {
console.log(res.data);
if (res.data === 1) {
that.ReservationPayment();//预约付款
} else {
wx.showModal({
title: '提示',
content: '该商品已下架',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
}
}
})
},
ReservationPayment(){
var that = this;
var bookId = that.data.bookId;
var studentId = that.data.studentId;
var nickName = that.data.nickName;
var url = app.globalData.huanbaoBase + 'buybook.php';
console.log(nickName)
console.log("预约购买")
wx.request({
url, //仅为示例,并非真实的接口地址
method: 'POST',
data: {
bookId: bookId,
buyStatus: 1,
buyStudentID: studentId,
buyUsername: nickName,
},
header: {
'content-type': 'application/x-www-form-urlencoded' // 默认值
},
success: function (res) {
console.log(res);
wx.showToast({
title: '预购成功',
icon: 'success',
duration: 1500
})
setTimeout(function(){
wx.switchTab({
url: '../order/order'
})
}, 1500)
}
})
}
})

@ -0,0 +1,3 @@
{
"navigationBarTitleText": "书本详情"
}

@ -0,0 +1,46 @@
<!--pages/movie-detail/movie-detail.wxml-->
<view class="{{theCover? 'coverFadeIn' : 'coverFadeOut'}}"></view>
<view class='detail'>
<view class='wrapper'>
<image src='{{detailData.url}}' class='detail-image'>
</image>
<view class='detail-sale'>
<view class='detail-price'>¥{{detailData.price}}</view>
<image src='./1.png' class='detail-selling-price-img'></image>
<view class='detail-sell'>售价</view>
</view>
<view class='detail-cont'>
<view class='detail-title'>书名:{{detailData.bookName}}</view>
<view>作者:{{detailData.bookAuthor}}</view>
<view>出版社:{{detailData.bookPress}}</view>
<view class='detail-poster'>发布者:{{detailData.poster}}</view>
<view class='detail-detail-box'>
<image class='detail-detail-image' src='./2.png'></image>
</view>
<view style='color: green'>辅助资料:{{detailData.isTextbook? "是" : "不是"}}</view>
<view style='color: green'>校区:{{detailData.campus}}</view>
<view style='color: green'>成色:{{detailData.conditions}}</view>
<view class='detail-detail'>产品详情:{{detailData.remark}}</view>
</view>
<view class='detail-bottom'>
<view class='addCart' bindtap='addMyCart'>加入购物车</view>
<view class='buyNow' bindtap='nowBuy'>立即购买</view>
</view>
</view>
<view class="{{thePay? 'paySlideUp' : 'paySlideDown'}}">
<view class='book-detail'>
<image src='{{detailData.url}}' class='pay-img'></image>
<view class='book-messege'>
<view class='bookName'>{{detailData.bookName}}</view>
<view class='bookPoster'>发布者:{{detailData.poster}}</view>
<view class='bookPrice'>价格:¥{{detailData.price}}</view>
</view>
<text bindtap="deletePay" data-index="{{index}}" class='delete'> × </text>
</view>
<view class='content'>
<view class='prompt'>提示:预约购买成功后,您将获得卖家的联系方式,请及时与卖家取得联系,进行线下当面付款交易。</view>
<view class='attention'>注意:该产品在您预约购买后,会自动下架,您是该产品的唯一买家。</view>
</view>
<view class='book-buy' bindtap='buy'>预约购买</view>
</view>
</view>

@ -0,0 +1,161 @@
/* pages/movie-detail/movie-detail.wxss */
.detail {
padding-bottom: 300rpx;
}
.coverFadeIn {
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100vh;
background-color: #333;
z-index: 10;
-moz-opacity: 0.7;
opacity: 0.7;
filter: alpha(opacity=70);
transition: opacity 300ms linear;
}
.detail-cont {
color: #666;
margin-left: 10rpx;
}
.detail-image {
position: absolute;
left: 50%;
margin-left: -230rpx;
width: 460rpx;
height: 600rpx;
margin-top: -620rpx;
}
.detail-sale {
display: flex;
width: 100%;
height: 80rpx;
margin-top: 640rpx;
}
.detail-selling-price-img {
flex: 1;
height: 100%;
width: 80rpx;
}
.detail-price {
background-color: #D0011B;
flex: 5;
color: #FFD2BB;
text-align: center;
line-height: 80rpx;
}
.detail-title {
font-size: 36rpx;
font-weight: 600;
color: red;
}
.detail-sell {
flex: 5;
background:linear-gradient(to right, #FEF841 , #FFC114);
color: #A8B527;
text-align: center;
line-height: 80rpx;
}
.detail-detail-box {
margin: 10rpx auto;
background-color: #F2F3F3;
width: 100%;
height: 80rpx;
}
.detail-detail-image {
position: absolute;
left: 50%;
margin-left: -200rpx;
width: 400rpx;
height: 80rpx;
}
.detail-bottom {
display: flex;
position: fixed;
bottom: 0rpx;
width: 100%;
height: 100rpx;
}
.addCart {
color: white;
text-align: center;
background-color: #F33C52;
flex: 1;
line-height: 100rpx;
}
.buyNow {
color: white;
text-align: center;
background-color: #D0011B;
flex: 1;
line-height: 100rpx;
}
.paySlideUp {
position: fixed;
bottom: 0rpx;
height: 640rpx;
width: 100%;
background-color: #fff;
z-index: 999;
transition: bottom 300ms linear;
}
.paySlideDown {
position: fixed;
bottom: -640rpx;
height: 640rpx;
width: 100%;
background-color: #fff;
z-index: 999;
transition: bottom 300ms linear;
}
.book-detail {
display: flex;
}
.pay-img{
width: 240rpx;
height: 280rpx;
margin: 20rpx;
}
.book-messege {
display: flex;
flex-direction: column;
justify-content: space-around;
}
.bookPrice {
color: #f40;
}
.delete {
position: absolute;
top: 20rpx;
right: 20rpx;
font-size: 48rpx;
color: #666;
}
.content {
background-color: #f3f3f3;
}
.attention,
.prompt {
padding: 10rpx 20rpx;
font-family: tahoma,arial,\5FAE\8F6F\96C5\9ED1,sans-serif;
font: 12px/1.5 tahoma,arial,"\5b8b\4f53";
font: 400 12px/1.5 "Microsoft Yahei",tahoma,arial
}
.book-buy {
margin: 30rpx auto;
color: #fff;
text-align: center;
line-height: 80rpx;
width: 700rpx;
height: 80rpx;
background: linear-gradient(to right, #FF7802,#FF4A00);
border-radius: 40rpx;
}

@ -0,0 +1,162 @@
var tcity = require("../../area/citys.js");
var app = getApp()
Page({
data: {
provinces: [],
province: "",
citys: [],
city: "",
countys: [],
county: '',
value: [0, 0, 0],
values: [0, 0, 0],
condition: false
},
bindViewTapindex: function () {
wx.navigateTo({
url: '../index/index'
})
},
onPullDownRefresh(){
wx.setNavigationBarTitle({
title: '地址管理'
});
wx.showNavigationBarLoading(); //在标题栏中显示加载图标
setTimeout(function () {
wx.stopPullDownRefresh(); //停止加载
wx.hideNavigationBarLoading(); //隐藏加载icon
}, 2000)
},
bindChange: function (e) {
//console.log(e);
var val = e.detail.value
var t = this.data.values;
var cityData = this.data.cityData;
if (val[0] != t[0]) {
console.log('province no ');
const citys = [];
const countys = [];
for (let i = 0; i < cityData[val[0]].sub.length; i++) {
citys.push(cityData[val[0]].sub[i].name)
}
for (let i = 0; i < cityData[val[0]].sub[0].sub.length; i++) {
countys.push(cityData[val[0]].sub[0].sub[i].name)
}
this.setData({
province: this.data.provinces[val[0]],
city: cityData[val[0]].sub[0].name,
citys: citys,
county: cityData[val[0]].sub[0].sub[0].name,
countys: countys,
values: val,
value: [val[0], 0, 0]
})
return;
}
if (val[1] != t[1]) {
console.log('city no');
const countys = [];
for (let i = 0; i < cityData[val[0]].sub[val[1]].sub.length; i++) {
countys.push(cityData[val[0]].sub[val[1]].sub[i].name)
}
this.setData({
city: this.data.citys[val[1]],
county: cityData[val[0]].sub[val[1]].sub[0].name,
countys: countys,
values: val,
value: [val[0], val[1], 0]
})
return;
}
if (val[2] != t[2]) {
console.log('county no');
this.setData({
county: this.data.countys[val[2]],
values: val
})
return;
}
},
open: function () {
this.setData({
condition: !this.data.condition
})
},
onLoad: function () {
console.log("onLoad");
var that = this;
tcity.init(that);
var cityData = that.data.cityData;
const provinces = [];
const citys = [];
const countys = [];
for (let i = 0; i < cityData.length; i++) {
provinces.push(cityData[i].name);
}
console.log('省份完成');
for (let i = 0; i < cityData[0].sub.length; i++) {
citys.push(cityData[0].sub[i].name)
}
console.log('city完成');
for (let i = 0; i < cityData[0].sub[0].sub.length; i++) {
countys.push(cityData[0].sub[0].sub[i].name)
}
that.setData({
'provinces': provinces,
'citys': citys,
'countys': countys,
'province': cityData[0].name,
'city': cityData[0].sub[0].name,
'county': cityData[0].sub[0].sub[0].name
})
console.log('初始化完成');
},
changeProvince:function(e) {
var that = this;
var province = this.data.province;
var provinceIndex = e.detail.value;
var provinces = this.data.provinces;
console.log(provinces[provinceIndex])
that.setData({
show: false,
province: provinces[provinceIndex]
})
},
changeCity: function(e) {
var that = this;
var city = this.data.city;
var cityIndex = e.detail.value;
var citys = this.data.citys;
console.log(citys[cityIndex])
that.setData({
show: false,
city: citys[cityIndex]
})
},
changeDistrict: function(e) {
var that = this;
var county = this.data.county;
var countyIndex = e.detail.value;
var countys = this.data.countys;
console.log(countys[countyIndex])
that.setData({
show: false,
county: countys[countyIndex]
})
}
})

@ -0,0 +1,5 @@
{
"navigationBarTitleText": "地址管理"
}

@ -0,0 +1,66 @@
<!--pages/address/address.wxml-->
<view class="hander">
</view>
<form bindsubmit="formSubmit">
<view class="form-list">
<!-- 用户姓名设置 -->
<view class="form-item">
<view class="form-item-lable">姓名:</view>
<view class="form-item-button">
<input type="text" value="{{address.name}}" name="name" />
</view>
</view>
<!-- 用户电话设置 -->
<view class="form-item">
<view class="form-item-lable">电话:</view>
<view class="form-item-button">
<input type="number" name="phone" value="{{address.phone}}" />
</view>
</view>
<view bindchange="bindChange" value="{{value}}">
<!-- 用户省份 -->
<view class="form-item">
<view class="form-item-lable">省份:</view>
<view class="form-item-button">
<picker bindchange='changeProvince' mode="selector" range="{{provinces}}" value="{{province}}">
<view>
<input type="text" name="province" value="{{province}}" placeholder='--请选择--' placeholder-style='color: #6699ff' disabled='true' /> </view>
</picker>
</view>
</view>
<!-- 用户城市 -->
<view class="form-item">
<view class="form-item-lable">城市:</view>
<view class="form-item-button">
<picker bindchange='changeCity' mode="selector" range="{{citys}}" value="{{citySelIndex}}">
<view>
<input type="text" placeholder='--请选择--' placeholder-style='color: #6699ff' class="hidden" name="city" value="{{city}}" disabled='true' />
</view>
</picker>
</view>
</view>
<!-- 用户区县 -->
<view class="form-item">
<view class="form-item-lable">区县:</view>
<view class="form-item-button">
<picker bindchange='changeDistrict' mode="selector" range="{{countys}}" value="{{districtSelIndex}}">
<view>
<input type="text" placeholder='--请选择--' placeholder-style='color: #6699ff' name="district" value="{{county}}" class="hidden" disabled='true' />
</view>
</picker>
</view>
</view>
</view>
<!-- 用户地址 -->
<view class="form-item">
<view class="form-item-lable">详细地址:</view>
<view class="form-item-button">
<input name="detail" value="{{address.detail}}" />
</view>
</view>
<button class="save-btn" form-type="submit" >保存</button>
</view>
</form>

@ -0,0 +1,46 @@
/* pages/address/address.wxss */
.hander {
display: flex;
width: 100%;
height: 60rpx;
background: #666666;
justify-content: flex-start;
align-items: center;
color: whitesmoke;
}
.form-list {
width: 90%;
margin: 20rpx;
display: flex;
flex-direction: column;
}
.form-item {
height: 80rpx;
display: flex;
align-items: center;
border-width: 0 0 1px 0;
border-bottom-style: solid;
border-color: gray;
}
.form-item-lable{
margin-left: 40rpx;
width: 300rpx;
height: 100%;
line-height: 80rpx;
}
.form-item-button {
color: gray;
}
input {
margin-left: 40rpx;
}
button {
width: 100%;
margin-top:20rpx;
text-align: center;
background: ec6a5c;
color: white;
}
.save-btn {
background-color: #1E68C9
}

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

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save