diff --git a/app.json b/app.json
index 0fbed9d..15169b4 100644
--- a/app.json
+++ b/app.json
@@ -1,104 +1,109 @@
{
- "pages": [
- "pages/index/index",
- "pages/travel/travel",
- "pages/resource/resource",
- "pages/template/template",
- "pages/train/train",
- "pages/cultureMap/cultureMap",
- "pages/order/order",
- "pages/venue/venue",
- "pages/center/center",
- "pages/myFriendCircle/myFriendCircle",
- "pages/friendCircle/friendCircle",
- "pages/orderDetail/orderDetail",
- "pages/broadcastList/broadcastList",
- "pages/myVenueOrder/myVenueOrder",
- "pages/broadcast/broadcast",
- "pages/activityDialog/activityDialog",
- "pages/teamDetail/teamDetail",
- "pages/volunteerRegister/volunteerRegister",
- "pages/volunteer/volunteer",
- "pages/heritage/heritage",
- "pages/broadcastDetail/broadcastDetail",
- "pages/venueDetail/venueDetail",
- "pages/book/book",
- "pages/register/register",
- "pages/login/login",
- "pages/newVolunteerActivity/newVolunteerActivity",
- "pages/newTeam/newTeam",
- "pages/volunteerTeam/volunteerTeam",
- "pages/cultureDetail/cultureDetail",
- "pages/activitySign/activitySign",
- "pages/activityDetail/activityDetail",
- "pages/activity/activity",
- "pages/newsDetail/newsDetail",
- "pages/newsList/newsList",
- "pages/myActivity/myActivity",
- "pages/myVolunteerTeam/myVolunteerTeam",
- "pages/myVolunteerActivity/myVolunteerActivity",
- "pages/serviceActivityDetail/serviceActivityDetail",
- "pages/shop/shopcategory"
- ],
- "subPackages": [{
- "root": "subpages/goodslist",
"pages": [
- "goodslist"
- ]
- }],
- "window": {
- "backgroundTextStyle": "light",
- "navigationBarBackgroundColor": "#9F1512",
- "navigationBarTitleText": "日喀则市数字文化云",
- "navigationBarTextStyle": "white"
- },
- "tabBar": {
- "color": "#BBBBBB",
- "borderStyle": "black",
- "selectedColor": "#000000",
- "list": [{
- "pagePath": "pages/index/index",
- "iconPath": "images/index.png",
- "text": "首页",
- "selectedIconPath": "images/index-on.png"
- },
- {
- "pagePath": "pages/activity/activity",
- "iconPath": "images/activity.png",
- "text": "活动",
- "selectedIconPath": "images/activity-on.png"
- },
- {
- "pagePath": "pages/venue/venue",
- "iconPath": "images/venue.png",
- "text": "场馆",
- "selectedIconPath": "images/venue-on.png"
- },
- {
- "pagePath": "pages/shop/shopcategory",
- "iconPath": "images/culture.png",
- "text": "商城",
- "selectedIconPath": "images/culture-on.png"
- },
- {
- "pagePath": "pages/center/center",
- "iconPath": "images/center.png",
- "text": "我的",
- "selectedIconPath": "images/center-on.png"
- }
- ]
- },
- "usingComponents": {
- "page-loading": "/components/loading/pageloading"
- },
- "permission": {
- "scope.userLocation": {
- "desc": "你的位置信息将用于您当前所在位置"
- }
- },
- "requiredPrivateInfos": [
- "getLocation"
- ],
- "style": "v2",
- "sitemapLocation": "sitemap.json"
+ "pages/index/index",
+ "pages/travel/travel",
+ "pages/resource/resource",
+ "pages/template/template",
+ "pages/train/train",
+ "pages/cultureMap/cultureMap",
+ "pages/order/order",
+ "pages/venue/venue",
+ "pages/center/center",
+ "pages/myFriendCircle/myFriendCircle",
+ "pages/friendCircle/friendCircle",
+ "pages/orderDetail/orderDetail",
+ "pages/broadcastList/broadcastList",
+ "pages/myVenueOrder/myVenueOrder",
+ "pages/broadcast/broadcast",
+ "pages/activityDialog/activityDialog",
+ "pages/teamDetail/teamDetail",
+ "pages/volunteerRegister/volunteerRegister",
+ "pages/volunteer/volunteer",
+ "pages/heritage/heritage",
+ "pages/broadcastDetail/broadcastDetail",
+ "pages/venueDetail/venueDetail",
+ "pages/book/book",
+ "pages/register/register",
+ "pages/login/login",
+ "pages/newVolunteerActivity/newVolunteerActivity",
+ "pages/newTeam/newTeam",
+ "pages/volunteerTeam/volunteerTeam",
+ "pages/cultureDetail/cultureDetail",
+ "pages/activitySign/activitySign",
+ "pages/activityDetail/activityDetail",
+ "pages/activity/activity",
+ "pages/newsDetail/newsDetail",
+ "pages/newsList/newsList",
+ "pages/myActivity/myActivity",
+ "pages/myVolunteerTeam/myVolunteerTeam",
+ "pages/myVolunteerActivity/myVolunteerActivity",
+ "pages/serviceActivityDetail/serviceActivityDetail",
+ "pages/shop/shopcategory",
+ "subpages/goodsdetail/goodsdetail",
+ "subpages/goodscar/goodscar"
+ ],
+ "subPackages": [
+ {
+ "root": "subpages/goodslist",
+ "pages": [
+ "goodslist"
+ ]
+ }
+ ],
+ "window": {
+ "backgroundTextStyle": "light",
+ "navigationBarBackgroundColor": "#9F1512",
+ "navigationBarTitleText": "日喀则市数字文化云",
+ "navigationBarTextStyle": "white"
+ },
+ "tabBar": {
+ "color": "#BBBBBB",
+ "borderStyle": "black",
+ "selectedColor": "#000000",
+ "list": [
+ {
+ "pagePath": "pages/index/index",
+ "iconPath": "images/index.png",
+ "text": "首页",
+ "selectedIconPath": "images/index-on.png"
+ },
+ {
+ "pagePath": "pages/activity/activity",
+ "iconPath": "images/activity.png",
+ "text": "活动",
+ "selectedIconPath": "images/activity-on.png"
+ },
+ {
+ "pagePath": "pages/venue/venue",
+ "iconPath": "images/venue.png",
+ "text": "场馆",
+ "selectedIconPath": "images/venue-on.png"
+ },
+ {
+ "pagePath": "pages/shop/shopcategory",
+ "iconPath": "images/culture.png",
+ "text": "商城",
+ "selectedIconPath": "images/culture-on.png"
+ },
+ {
+ "pagePath": "pages/center/center",
+ "iconPath": "images/center.png",
+ "text": "我的",
+ "selectedIconPath": "images/center-on.png"
+ }
+ ]
+ },
+ "usingComponents": {
+ "page-loading": "/components/loading/pageloading"
+ },
+ "permission": {
+ "scope.userLocation": {
+ "desc": "你的位置信息将用于您当前所在位置"
+ }
+ },
+ "requiredPrivateInfos": [
+ "getLocation"
+ ],
+ "style": "v2",
+ "sitemapLocation": "sitemap.json"
}
\ No newline at end of file
diff --git a/pages/center/center.js b/pages/center/center.js
index 8b8ed4a..3a818fd 100644
--- a/pages/center/center.js
+++ b/pages/center/center.js
@@ -2,332 +2,338 @@
var app = getApp()
Page({
- /**
- * 页面的初始数据
- */
- data: {
- randomName: true,
- showPhone: true,
- gotCode: false,
- restTime: 120,
- timer: '',
- userAvatar: '',
- token: '',
- userInfo: {},
- usercenterUrl: app.usercenterUrl,
- sourcePath: '/route/file/download/true/',
- phone: '',
- code: '',
- isLoading: false
- },
- // 选择头像来源
- changeAvatar: function () {
- var self = this
- wx.showActionSheet({
- itemList: ['从相册中选择','拍照'],
- success: function (res) {
- if (!res.cancel) {
- if (res.tapIndex == 0) {
- self.chooseAvatar('album')
- } else {
- self.chooseAvatar('camera')
- }
- }
- }
- })
- },
- // 选择图片
- chooseAvatar: function (type) {
- var self = this
- wx.chooseImage({
- count: 1,
- sizeType: ['original', 'compressed'],
- sourceType: [type],
- success: function (res) {
- var avatar = res.tempFilePaths[0];
- app.restAjax.file(app.restAjax.path('{usercenterUrl}/app/file/uploadimage', [app.usercenterUrl]), avatar, 'image', {
- headers: {
- token: self.data.token
- }
- }, function (code, data) {
- var id = JSON.parse(data).data
- self.uploadAvatar(id)
- }, function (code, data) {
- console.log(data)
- })
- self.setData({
- userAvatar: avatar
- })
- }
- })
- },
- // 上传
- uploadAvatar: function (avatarId) {
- var self = this
- app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/user/updateuseravatar', [app.usercenterUrl]), {
- avatar: avatarId
- }, {
- headers: {
- token: self.data.token
- }
- }, function (code, data) {
- wx.setStorageSync('token', data.data);
- self.getUserInfo()
- }, function (code, data) {
- console.log(data)
- })
- },
- // 获取token
- getToken: function () {
- var self = this
- wx.getStorage({
- key: 'token',
- success: function(res) {
- self.setData({
- token: res.data
- })
- self.getUserInfo()
- },
- })
- },
- /**
- * 跳转到我的活动
- */
- toMyJoinActivity(){
- wx.navigateTo({
- url: '/pages/myActivity/myActivity',
- })
- },
- /**
- * 跳转到我的预订列表
- */
- toMyOrder: function() {
- wx.navigateTo({
- url: '../order/order',
- })
- },
- /**
- * 跳转到我的志愿团队页面
- */
- toMyTeam: function() {
- wx.navigateTo({
- url: '../myVolunteerTeam/myVolunteerTeam',
- })
- },
- /**
- * 跳转到我的志愿活动页面
- */
- toMyVolunteerActivity: function() {
- wx.navigateTo({
- url: '../myVolunteerActivity/myVolunteerActivity',
- })
- },
- /**
- * 跳转到我发布的朋友圈页面
- */
- toMyFirend: function () {
- wx.navigateTo({
- url: '../myFriendCircle/myFriendCircle',
- })
- },
- /**
- * 跳转到我预定的场馆页面
- */
- toMyOrder: function () {
- wx.navigateTo({
- url: '../order/order',
- })
- },
- // 获取输入的手机号
- phoneNum: function (res) {
- this.setData({
- phone: res.detail.value
- })
- },
- // 校验手机号
- testPhone: function () {
- var self = this
- if (self.data.phone) {
- if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.data.phone)) {
- wx.showToast({
- title: '请输入正确的手机号',
- icon: 'none',
- duration: 1500
- })
- } else {
- self.getCode()
- }
- } else {
- wx.showToast({
- title: '手机号不能为空',
- icon: 'none',
- duration: 1500
- })
- }
- },
- // 提交绑定手机
- submitPhone: function () {
- var self = this;
- self.setData({
- isConfirm: true
- })
- app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/user/updateminiappdefaultusername', [app.usercenterUrl]), {
- phone: self.data.phone
- }, {
- headers: {
- token: self.data.token
- }
- }, function (code, data) {
- wx.setStorageSync('token', data.data);
- wx.setStorageSync('isRandomUsername', 0)
- clearInterval(self.data.timer)
- self.setData({
- showPhone: false
- })
- wx.showTabBar();
- self.getUserInfo()
- }, function (code, data) {
- app.dialog.msg(data.msg);
- self.setData({
- isConfirm: false
- })
- })
- },
- // // 验证码
- // inputCode: function (e) {
- // this.setData({
- // code: e.detail.value
- // })
- // },
- getPhoneNumber: function (e) {
- var self = this
- self.setData({
- isLoading: true
- })
- console.log(e)
- if (e.detail.errMsg == 'getPhoneNumber:ok') {
- var info = {
- encryptedData: e.detail.encryptedData,
- iv: e.detail.iv
- }
- // app.dialog.loading('正在加载');
- app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/miniapp/update-phone', [app.usercenterUrl]), info, {
- headers: {
- token: self.data.token
- }
- }, function (code, data) {
- // wx.hideLoading();
- self.setData({
- isLoading: false
- })
- wx.setStorageSync('token', data.data);
- wx.setStorageSync('isRandomUsername', '0');
- self.setData({
- randomName: false,
- token: data.data
- })
- self.getUserInfo()
- app.dialog.msg('绑定成功');
- })
- } else {
- self.setData({
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ randomName: true,
+ showPhone: true,
+ gotCode: false,
+ restTime: 120,
+ timer: '',
+ userAvatar: '',
+ token: '',
+ userInfo: {},
+ usercenterUrl: app.usercenterUrl,
+ sourcePath: '/route/file/download/true/',
+ phone: '',
+ code: '',
isLoading: false
- })
- }
- },
- // 判断用户是否为随机名称
- isRandomName: function () {
- var self = this
- wx.getStorage({
- key: 'isRandomUsername',
- success: function (res) {
- if (res.data == 1) {
- self.setData({
- randomName: true
- })
+ },
+ // 选择头像来源
+ changeAvatar: function () {
+ var self = this
+ wx.showActionSheet({
+ itemList: ['从相册中选择', '拍照'],
+ success: function (res) {
+ if (!res.cancel) {
+ if (res.tapIndex == 0) {
+ self.chooseAvatar('album')
+ } else {
+ self.chooseAvatar('camera')
+ }
+ }
+ }
+ })
+ },
+ // 选择图片
+ chooseAvatar: function (type) {
+ var self = this
+ wx.chooseImage({
+ count: 1,
+ sizeType: ['original', 'compressed'],
+ sourceType: [type],
+ success: function (res) {
+ var avatar = res.tempFilePaths[0];
+ app.restAjax.file(app.restAjax.path('{usercenterUrl}/app/file/uploadimage', [app.usercenterUrl]), avatar, 'image', {
+ headers: {
+ token: self.data.token
+ }
+ }, function (code, data) {
+ var id = JSON.parse(data).data
+ self.uploadAvatar(id)
+ }, function (code, data) {
+ console.log(data)
+ })
+ self.setData({
+ userAvatar: avatar
+ })
+ }
+ })
+ },
+ // 上传
+ uploadAvatar: function (avatarId) {
+ var self = this
+ app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/user/updateuseravatar', [app.usercenterUrl]), {
+ avatar: avatarId
+ }, {
+ headers: {
+ token: self.data.token
+ }
+ }, function (code, data) {
+ wx.setStorageSync('token', data.data);
+ self.getUserInfo()
+ }, function (code, data) {
+ console.log(data)
+ })
+ },
+ // 获取token
+ getToken: function () {
+ var self = this
+ wx.getStorage({
+ key: 'token',
+ success: function (res) {
+ self.setData({
+ token: res.data
+ })
+ self.getUserInfo()
+ },
+ })
+ },
+ // 购物车
+ toShopCar() {
+ wx.navigateTo({
+ url: '/subpages/goodscar/goodscar',
+ })
+ },
+ /**
+ * 跳转到我的活动
+ */
+ toMyJoinActivity() {
+ wx.navigateTo({
+ url: '/pages/myActivity/myActivity',
+ })
+ },
+ /**
+ * 跳转到我的预订列表
+ */
+ toMyOrder: function () {
+ wx.navigateTo({
+ url: '../order/order',
+ })
+ },
+ /**
+ * 跳转到我的志愿团队页面
+ */
+ toMyTeam: function () {
+ wx.navigateTo({
+ url: '../myVolunteerTeam/myVolunteerTeam',
+ })
+ },
+ /**
+ * 跳转到我的志愿活动页面
+ */
+ toMyVolunteerActivity: function () {
+ wx.navigateTo({
+ url: '../myVolunteerActivity/myVolunteerActivity',
+ })
+ },
+ /**
+ * 跳转到我发布的朋友圈页面
+ */
+ toMyFirend: function () {
+ wx.navigateTo({
+ url: '../myFriendCircle/myFriendCircle',
+ })
+ },
+ /**
+ * 跳转到我预定的场馆页面
+ */
+ toMyOrder: function () {
+ wx.navigateTo({
+ url: '../order/order',
+ })
+ },
+ // 获取输入的手机号
+ phoneNum: function (res) {
+ this.setData({
+ phone: res.detail.value
+ })
+ },
+ // 校验手机号
+ testPhone: function () {
+ var self = this
+ if (self.data.phone) {
+ if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.data.phone)) {
+ wx.showToast({
+ title: '请输入正确的手机号',
+ icon: 'none',
+ duration: 1500
+ })
+ } else {
+ self.getCode()
+ }
} else {
- self.setData({
- randomName: false
- })
+ wx.showToast({
+ title: '手机号不能为空',
+ icon: 'none',
+ duration: 1500
+ })
}
- }
- })
- },
- // 获取用户信息
- getUserInfo: function () {
- var self = this
- app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/user/get-app-user', [app.usercenterUrl]), {}, {
- headers: {
- token: self.data.token
- }
- }, function (code, data) {
- self.setData({
- userInfo: data
- })
- }, function (code, data) {
- app.dialog.msg(data.msg);
- })
- },
- cancelPhone: function () {
- this.setData({
- showPhone: false
- })
- wx.showTabBar()
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.isRandomName();
- this.getToken();
- },
+ },
+ // 提交绑定手机
+ submitPhone: function () {
+ var self = this;
+ self.setData({
+ isConfirm: true
+ })
+ app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/user/updateminiappdefaultusername', [app.usercenterUrl]), {
+ phone: self.data.phone
+ }, {
+ headers: {
+ token: self.data.token
+ }
+ }, function (code, data) {
+ wx.setStorageSync('token', data.data);
+ wx.setStorageSync('isRandomUsername', 0)
+ clearInterval(self.data.timer)
+ self.setData({
+ showPhone: false
+ })
+ wx.showTabBar();
+ self.getUserInfo()
+ }, function (code, data) {
+ app.dialog.msg(data.msg);
+ self.setData({
+ isConfirm: false
+ })
+ })
+ },
+ // // 验证码
+ // inputCode: function (e) {
+ // this.setData({
+ // code: e.detail.value
+ // })
+ // },
+ getPhoneNumber: function (e) {
+ var self = this
+ self.setData({
+ isLoading: true
+ })
+ console.log(e)
+ if (e.detail.errMsg == 'getPhoneNumber:ok') {
+ var info = {
+ encryptedData: e.detail.encryptedData,
+ iv: e.detail.iv
+ }
+ // app.dialog.loading('正在加载');
+ app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/miniapp/update-phone', [app.usercenterUrl]), info, {
+ headers: {
+ token: self.data.token
+ }
+ }, function (code, data) {
+ // wx.hideLoading();
+ self.setData({
+ isLoading: false
+ })
+ wx.setStorageSync('token', data.data);
+ wx.setStorageSync('isRandomUsername', '0');
+ self.setData({
+ randomName: false,
+ token: data.data
+ })
+ self.getUserInfo()
+ app.dialog.msg('绑定成功');
+ })
+ } else {
+ self.setData({
+ isLoading: false
+ })
+ }
+ },
+ // 判断用户是否为随机名称
+ isRandomName: function () {
+ var self = this
+ wx.getStorage({
+ key: 'isRandomUsername',
+ success: function (res) {
+ if (res.data == 1) {
+ self.setData({
+ randomName: true
+ })
+ } else {
+ self.setData({
+ randomName: false
+ })
+ }
+ }
+ })
+ },
+ // 获取用户信息
+ getUserInfo: function () {
+ var self = this
+ app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/user/get-app-user', [app.usercenterUrl]), {}, {
+ headers: {
+ token: self.data.token
+ }
+ }, function (code, data) {
+ self.setData({
+ userInfo: data
+ })
+ }, function (code, data) {
+ app.dialog.msg(data.msg);
+ })
+ },
+ cancelPhone: function () {
+ this.setData({
+ showPhone: false
+ })
+ wx.showTabBar()
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.isRandomName();
+ this.getToken();
+ },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
- },
+ },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
- },
+ },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
- },
+ },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
- },
+ },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
- },
+ },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
- },
+ },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
- }
+ }
})
\ No newline at end of file
diff --git a/pages/center/center.wxml b/pages/center/center.wxml
index 6f9900d..ed6b883 100644
--- a/pages/center/center.wxml
+++ b/pages/center/center.wxml
@@ -41,10 +41,10 @@
我的志愿活动
-
+ 购物车
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂无数据
+
+
+
\ No newline at end of file
diff --git a/subpages/goodscar/goodscar.wxss b/subpages/goodscar/goodscar.wxss
new file mode 100644
index 0000000..ecad7d5
--- /dev/null
+++ b/subpages/goodscar/goodscar.wxss
@@ -0,0 +1,43 @@
+/* subpages/goodscar/goodscar.wxss */
+
+.category-empty {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ text-align: center;
+ align-self: center;
+
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ transform: translateX(-50%)translateY(-50%);
+}
+
+.category-empty image {
+ width: 180rpx;
+ height: 120rpx;
+}
+
+.category-empty .hint {
+ margin-top: 30rpx;
+ font-size: 32rpx;
+}
+
+.goods-item {}
+
+.check {
+ width: 48rpx;
+ height: 48rpx;
+}
+
+.goods {
+ display: flex;
+ flex-direction: row;
+ justify-content: flex-start;
+
+}
+.goods .goods-img{}
+.goods-content{
+
+}
\ No newline at end of file
diff --git a/subpages/goodsdetail/goodsdetail.js b/subpages/goodsdetail/goodsdetail.js
new file mode 100644
index 0000000..311ce03
--- /dev/null
+++ b/subpages/goodsdetail/goodsdetail.js
@@ -0,0 +1,129 @@
+// subpages/goodsdetail/goodsdetail.js
+var app = getApp();
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ goodsId: "",
+ isHidePageloading: false,
+ detailBean: {},
+ currentStandard: {},
+ standardList: [],
+ curStandardIndex: 0,
+ imgUrl: app.shopImgUrl,
+ carList: [],
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ this.setData({
+ goodsId: options.id
+ })
+ this.getGoodsDetail();
+
+ },
+ //获取商品详情
+ getGoodsDetail() {
+ var _self = this
+ app.restAjax.get(app.restAjax.path('{shopUrl}/app/shopgoods/getrelease/{goodsId}',
+ [app.shopUrl, _self.data.goodsId]),
+ null,
+ null,
+ function (code, data) {
+ if (data) {
+ if (data.goodsPhotos.length > 0) {
+ var photos = data.goodsPhotos.split(',');
+ data.photoList = photos;
+ } else {
+ data.photoList = []
+ }
+ data.goodsPrice = 0;
+ data.goodsStandarName = "";
+ data.goodsStandarId = "";
+ data.isCheck = false;
+ data.carAmount = 0;
+ _self.setData({
+ detailBean: data,
+ })
+ }
+ },
+ function (code, data) {
+ app.dialog.msg(data.msg);
+ },
+ function () {
+ _self.getGoodsStandardList();
+ })
+ },
+ // carAmount;
+ // goodsPrice;
+ // goodsStandarId;
+ // goodsStandarName;
+ // isCheck;
+ //获取商品附加信息
+ getGoodsStandardList() {
+ var _self = this
+ _self.data.detailBean.goodsPrice = 0;
+ _self.data.detailBean.goodsStandarName = "";
+ _self.data.detailBean.goodsStandarId = "";
+ _self.data.detailBean.isCheck = false;
+ _self.data.detailBean.carAmount = 0;
+
+ app.restAjax.get(app.restAjax.path('{shopUrl}/app/shopgoodsitem/listrelease/{goodsId}',
+ [app.shopUrl, _self.data.goodsId]),
+ null,
+ null,
+ function (code, data) {
+ if (data && data.length > 0) {
+ _self.data.detailBean.goodsPrice = data[0].goodsItemUnitPrice;
+ _self.data.detailBean.goodsStandarName = data[0].goodsItemName;
+ _self.data.detailBean.goodsStandarId = data[0].goodsItemId;
+ _self.setData({
+ standardList: data,
+ currentStandard: data[0],
+ isHidePageloading: true,
+ detailBean: _self.data.detailBean
+ })
+ } else {
+ _self.setData({
+ isHidePageloading: true
+ })
+ }
+ },
+ function (code, data) {
+ app.dialog.msg(data.msg);
+ _self.setData({
+ isHidePageloading: true
+ })
+ },
+ function () {
+ _self.setData({
+ isHidePageloading: true
+ })
+ })
+ },
+ doSelStandard(e) {
+ var item = e.currentTarget.dataset.item;
+ var index = e.currentTarget.dataset.index;
+ this.data.detailBean.goodsPrice = item.goodsItemUnitPrice;
+ this.data.detailBean.goodsStandarName = item.goodsItemName;
+ this.data.detailBean.goodsStandarId = item.goodsItemId;
+ this.setData({
+ currentStandard: item,
+ curStandardIndex: index,
+ detailBean: this.data.detailBean
+ })
+ },
+ // 添加购物车
+ addToCar() {
+ //判断购物车中是否存在该商品
+ var _self = this;
+ for (let i = 0; i < _self.data.carList.length; i++) {
+ var item = _self.data.carList[i];
+
+ }
+ }
+})
\ No newline at end of file
diff --git a/subpages/goodsdetail/goodsdetail.json b/subpages/goodsdetail/goodsdetail.json
new file mode 100644
index 0000000..3928faa
--- /dev/null
+++ b/subpages/goodsdetail/goodsdetail.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/subpages/goodsdetail/goodsdetail.wxml b/subpages/goodsdetail/goodsdetail.wxml
new file mode 100644
index 0000000..6cb7388
--- /dev/null
+++ b/subpages/goodsdetail/goodsdetail.wxml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 库存:{{currentStandard.goodsItemTotal}}
+ 销量:{{detailBean.goodsSalesVolume}}
+ 评分:{{detailBean.userEvaluate}}
+ {{detailBean.goodsNotFreight==1? '包邮':'不包邮'}}
+
+
+ {{detailBean.goodsName}}
+
+
+ {{detailBean.shopName}}
+
+
+
+
+
+
+ 规格
+
+
+
+
+
+ {{item.goodsItemName}}
+
+
+
+
+
+
+
+
+ 详情
+
+
+
+
+
+ {{it.parameterName}}
+ {{it.shopGoodsParameterContent}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ¥
+ {{currentStandard.goodsItemUnitPrice}}
+
+
+
+
+
+ {{carList.length}}
+
+ 购物车
+
+ 添加购物车
+
+
+
\ No newline at end of file
diff --git a/subpages/goodsdetail/goodsdetail.wxss b/subpages/goodsdetail/goodsdetail.wxss
new file mode 100644
index 0000000..7771aa2
--- /dev/null
+++ b/subpages/goodsdetail/goodsdetail.wxss
@@ -0,0 +1,296 @@
+/* subpages/goodsdetail/goodsdetail.wxss */
+page {
+ background: #f2f2f2;
+}
+
+.container-box {
+ width: 100%;
+ height: auto;
+ display: flex;
+ flex-direction: column;
+ margin-bottom: 150rpx;
+}
+
+.banner {
+ height: 500rpx;
+}
+
+.banner image {
+ width: 100%;
+ height: 500rpx;
+}
+
+
+.goods-type {
+ display: flex;
+ flex-direction: row;
+ margin-top: 10rpx;
+
+}
+
+.name-box {
+ padding: 30rpx;
+ display: flex;
+ flex-direction: column;
+ box-shadow: 10rpx 5rpx 10rpx #dfdfdf;
+ background: white;
+ margin: 20rpx;
+ border-radius: 10rpx;
+}
+
+.type-box {
+ display: flex;
+ flex-direction: row;
+ justify-content: flex-start;
+ align-content: center;
+}
+
+.type-item {
+ background: #f2f2f2;
+ color: #e70606;
+ padding: 10rpx;
+ font-size: 28rpx;
+}
+
+.type-item:nth-of-type(n+2) {
+ margin-left: 20rpx;
+}
+
+.goods-name {
+ font-size: 32rpx;
+ color: black;
+ margin-top: 20rpx;
+}
+
+.shop-name {
+ margin-top: 20rpx;
+ font-size: 28rpx;
+ color: gray;
+}
+
+.standard-box {
+ padding: 30rpx;
+ display: flex;
+ flex-direction: column;
+ box-shadow: 10rpx 5rpx 10rpx #dfdfdf;
+ background: white;
+ margin: 20rpx;
+ border-radius: 10rpx;
+}
+
+.title-item {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+}
+
+.line {
+ height: 30rpx;
+ width: 10rpx;
+ background: #e70606;
+}
+
+.title-name {
+ margin-left: 30rpx;
+}
+
+.standard-content {
+ display: flex;
+ flex-direction: row;
+}
+
+.standard-item {
+ display: flex;
+ flex-direction: row;
+ border: 1rpx solid #dfdfdf;
+ border-radius: 3rpx;
+ margin: 10rpx;
+ text-align: center;
+ justify-content: center;
+ align-items: center;
+ padding: 0rpx 0rpx 0rpx 5rpx;
+}
+
+.name {
+ text-align: center;
+ margin: 0rpx 20rpx;
+ font-size: 28rpx;
+}
+
+.standard-item image {
+ width: 48rpx;
+ height: 48rpx;
+}
+
+.standard-item-sel {
+ display: flex;
+ flex-direction: row;
+ border: 1rpx solid #e70606;
+ border-radius: 3rpx;
+ margin: 10rpx;
+ text-align: center;
+ justify-content: center;
+ align-items: center;
+ padding: 0rpx 0rpx 0rpx 5rpx;
+}
+
+.standard-item-sel image {
+ width: 48rpx;
+ height: 48rpx;
+}
+
+.desc-box {
+ display: flex;
+ flex-direction: column;
+ margin: 20rpx;
+ box-shadow: 10rpx 5rpx 10rpx #dfdfdf;
+ background: white;
+ padding: 30rpx;
+}
+
+.desc-video {
+ margin-top: 20rpx;
+ width: 100%;
+}
+
+.desc-img {
+ margin-top: 20rpx;
+}
+
+.desc-txt {
+ margin-top: 20rpx;
+}
+
+.bottom-box {
+ display: flex;
+ flex-direction: column;
+ background: white;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+
+}
+
+.bottom-content {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ align-items: center;
+ margin: 25rpx;
+}
+
+.bottom-price {
+ display: flex;
+ flex-direction: row;
+ justify-content: flex-start;
+ align-items: baseline;
+ color: #e70606;
+ text-align: center;
+ font-weight: bold;
+}
+
+.price-icon {
+ font-size: 30rpx;
+}
+
+.price-content {
+ font-size: 55rpx;
+}
+
+
+.icon-btn {
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
+ align-items: center;
+}
+
+.car-icon {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ font-size: 30rpx;
+}
+
+.car-icon image {
+ width: 48rpx;
+ height: 48rpx;
+ align-items: center;
+ align-self: center;
+ margin-left: 25rpx;
+ margin-top: 10rpx;
+}
+
+.car {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ justify-content: center;
+}
+
+.car-num {
+ position: relative;
+ right: 10rpx;
+ top: -10rpx;
+ background: #e70606;
+ color: white;
+ width: 48rpx;
+ height: 48rpx;
+ border-radius: 50%;
+ text-align: center;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ font-size: 25rpx;
+}
+
+.car-add {
+ background: linear-gradient(to right bottom, rgb(245, 74, 74), rgb(221, 5, 5) 70px);
+ color: white;
+ padding: 15rpx;
+ border-radius: 10rpx;
+ margin-left: 20rpx;
+ font-size: 32rpx;
+}
+
+.params-box {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ margin-top: 20rpx;
+}
+
+.params-item {
+ display: flex;
+ flex-direction: row;
+ width: 100%;
+}
+
+.params-item:first-child {
+ border: 1rpx solid #6e6e6e;
+}
+
+.params-item:nth-of-type(n+2) {
+ border-bottom: 1rpx solid #6e6e6e;
+ border-left: 1rpx solid #6e6e6e;
+ border-right: 1rpx solid #6e6e6e;
+}
+
+.params-title {
+ width: 40%;
+ border-right: 1rpx solid #6e6e6e;
+ padding: 5rpx;
+ text-align: center;
+ font-size: 32rpx;
+}
+
+.params-content {
+ width: 60%;
+ text-align: center;
+ font-size: 32rpx;
+ padding: 5rpx;
+}
\ No newline at end of file
diff --git a/subpages/goodslist/goodslist.js b/subpages/goodslist/goodslist.js
index ee5b782..baf6627 100644
--- a/subpages/goodslist/goodslist.js
+++ b/subpages/goodslist/goodslist.js
@@ -24,6 +24,14 @@ Page({
})
this.getGoodsList();
},
+ inputKeywords(event) {
+ this.setData({
+ keywords: event.detail.value
+ })
+ },
+ doSearch() {
+ wx.startPullDownRefresh()
+ },
getGoodsList() {
var _self = this
var info = {
@@ -69,5 +77,10 @@ Page({
page: _self.data.page += 1
})
_self.getGoodsList()
+ },
+ goDetail(e) {
+ wx.navigateTo({
+ url: '/subpages/goodsdetail/goodsdetail?id=' + e.currentTarget.dataset.id,
+ })
}
})
\ No newline at end of file
diff --git a/subpages/goodslist/goodslist.wxml b/subpages/goodslist/goodslist.wxml
index c681407..0a2c56f 100644
--- a/subpages/goodslist/goodslist.wxml
+++ b/subpages/goodslist/goodslist.wxml
@@ -1,14 +1,14 @@
-
- 搜索
+
+ 搜索
-
-
+
+
- {{item.goodsName}}
+
¥ {{item.goodsPrice}}
销量:{{item.goodsSalesVolume}}
diff --git a/subpages/images/ic_goods_type_default.png b/subpages/images/ic_goods_type_default.png
new file mode 100644
index 0000000..306f9e9
Binary files /dev/null and b/subpages/images/ic_goods_type_default.png differ
diff --git a/subpages/images/ic_shop_car_icon.png b/subpages/images/ic_shop_car_icon.png
new file mode 100644
index 0000000..b681f01
Binary files /dev/null and b/subpages/images/ic_shop_car_icon.png differ