소스 검색

小程序新增专辑

wrh 2 년 전
부모
커밋
d77982e993

+ 9 - 6
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/albumEdit/albumEdit.js

@@ -5,9 +5,14 @@ Page({
 	 * 页面的初始数据
 	 */
 	data: {
+		// 默认归属日期
 		date: '2021-01-01',
+		// 默认作品年代
 		index: 0,
-		array: ['美国', '中国', '巴西', '日本'],
+		// 作品年代
+		array: ['解放前', '解放后-80年代', '80年代-新世纪', '新世纪-千禧年'],
+		// 图片
+		img: ''
 	},
 	// 提交
 	formSubmit(e) {
@@ -17,7 +22,7 @@ Page({
 	bindUpload: function (e) {
 		var that = this
 		wx.chooseMedia({
-			count: that.data.count, // 默认3
+			count: 1, // 默认3
 			sizeType: ["original", "compressed"], // 可以指定是原图还是压缩图,默认二者都有
 			sourceType: ["album", "camera"], // 可以指定来源是相册还是相机,默认二者都有
 			success: function (res) {
@@ -38,11 +43,9 @@ Page({
 									icon: "none",
 									duration: 1500
 								})
-
-								that.data.imgs.push(JSON.parse(res.data).data)
-
+								that.data.img.push(JSON.parse(res.data).data)
 								that.setData({
-									imgs: that.data.imgs
+									img: that.data.imgs
 								})
 							}
 						},

+ 1 - 1
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/albumEdit/albumEdit.wxml

@@ -1,5 +1,5 @@
 <!--pages/albumEdit/albumEdit.wxml-->
-<view style="background: #F0F0F0;height: 98vh;padding-top: 20rpx;">
+<view style="background: #F0F0F0;padding: 20rpx 0 40rpx 0;">
 	<form catchsubmit="formSubmit">
 		<view style="width: 700rpx;background: #FFFFFF;border-radius: 10rpx;margin: auto;">
 			<view style="display: flex;border-bottom: 1px solid #DDDDDD;margin: 20rpx 18rpx;">