Commit 4444d73f authored by Edwise's avatar Edwise 🍷

1234

parent 07783be2
...@@ -51,6 +51,15 @@ ...@@ -51,6 +51,15 @@
position: absolute; position: absolute;
transform-origin: 50% 50% 0rpx; transform-origin: 50% 50% 0rpx;
} }
.catname .catnameNo {
width: 282rpx;
height: 106rpx;
opacity: 1;
left: 111rpx;
top: 736rpx;
position: absolute;
transform-origin: 50% 50% 0rpx;
}
.catname .catnameinput { .catname .catnameinput {
width: 500rpx; width: 500rpx;
height: 147rpx; height: 147rpx;
......
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
<image class="catnamedialogbg" src={{resList['50779aee-069e-4dd9-b2ff-88beda9f43d1'].url}} /> <image class="catnamedialogbg" src={{resList['50779aee-069e-4dd9-b2ff-88beda9f43d1'].url}} />
<label class="catnamedialoglabel">铲屎官~帮我取个名字吧!喵~</label> <label class="catnamedialoglabel">铲屎官~帮我取个名字吧!喵~</label>
</view> </view>
<image class="catnamesure btn" onTap="catNameSure" src={{resList['c7916d41-ea9d-4f8e-b5aa-e2060d6ae265'].url}} /> <image class="catnamesure btn" a:if="{{btnV}}" onTap="catNameSure" src={{resList['c7916d41-ea9d-4f8e-b5aa-e2060d6ae265'].url}} />
<image class="catnameNo" a:if="{{!btnV}}" src={{resList['3fe9ac60-f1aa-4da3-93da-c67e5a9dc3a6'].url}} />
<view class="catnameinput"> <view class="catnameinput">
<image class="catnameinputbg" src={{resList['947d970f-52bf-4319-82f0-a3e65620ed75'].url}} /> <image class="catnameinputbg" src={{resList['947d970f-52bf-4319-82f0-a3e65620ed75'].url}} />
<input class="catnameinputlabel" maxlength="6" onFocus="getCatName" onInput="getCatName" onConfirm="getCatName" onBlur="getCatName" value="{{catName}}" placeholder="输入名字" name="" ></input> <input class="catnameinputlabel" maxlength="6" onInput="getCatName" controlled="true" value="{{catNameText}}" placeholder="输入名字" name="" ></input>
<text class="catnameinputrandom" onTap="randomName" >随机名字</text> <text class="catnameinputrandom" onTap="randomName" >随机名字</text>
</view> </view>
</view> </view>
...@@ -15,13 +15,16 @@ const { ...@@ -15,13 +15,16 @@ const {
Component({ Component({
props: { props: {
//catImgArr: ["90b114e6-83cb-46f1-b607-f88c50077b05", "4e471df6-01ab-421d-ba0b-084b2110dc6d", "003e9904-aee4-4b8d-8d5d-fb4b1188bec1", "90283bd3-4b18-4535-97a8-90318f068781"], //catImgArr: ["90b114e6-83cb-46f1-b607-f88c50077b05", "4e471df6-01ab-421d-ba0b-084b2110dc6d", "003e9904-aee4-4b8d-8d5d-fb4b1188bec1", "90283bd3-4b18-4535-97a8-90318f068781"],
catImgArr:["3e6311fd-15ab-4656-bb84-1c49f4ad4ed9","bbb10ff2-f4fb-43a8-83d8-abbb04949f2d","9fc6517e-debe-4457-88ef-9c733d5bc072","ecb49f23-2e65-4507-8be6-1eee021a3b35"], catImgArr: ["3e6311fd-15ab-4656-bb84-1c49f4ad4ed9", "bbb10ff2-f4fb-43a8-83d8-abbb04949f2d", "9fc6517e-debe-4457-88ef-9c733d5bc072", "ecb49f23-2e65-4507-8be6-1eee021a3b35"],
catName: "" catName: ""
}, },
data: { data: {
resList: resList, resList: resList,
catName: "", catNameText: "",
catImg: "" catImg: "",
btnV: false,
isControlled: false
}, },
methods: { methods: {
/**获取字符串字符长度 */ /**获取字符串字符长度 */
...@@ -54,22 +57,37 @@ Component({ ...@@ -54,22 +57,37 @@ Component({
console.log("随即名字") console.log("随即名字")
let name = "Edwise" let name = "Edwise"
this.setData({ this.setData({
catName: name catNameText: name
}) })
this.props.catName = name; this.setCatName(name);
},
},
/**获取名字 */ /**获取名字 */
getCatName(e) { getCatName(e) {
// console.log(e.detail.value) this.setData({
this.props.catName = e.detail.value; catNameText: e.detail.value
// console.log(this.props.catName) })
console.log("input", e)
this.setCatName(e.detail.value)
},
/**设置名字 */
setCatName(name) {
this.props.catName = name;
if (this.props.catName && this.props.catName.length > 0) {
this.setData({
btnV: true
})
} else {
this.setData({
btnV: false
})
}
}, },
/**确认领养 */ /**确认领养 */
async catNameSure() { async catNameSure() {
let name = this.props.catName; let name = this.props.catName;
let len = this.getlen(name); let len = this.getlen(name);
console.log("名称字符长度",len) console.log("名称字符长度", len)
if (len <= 0) { if (len <= 0) {
my.showToast({ my.showToast({
content: "名字不能为空哦", content: "名字不能为空哦",
......
...@@ -526,6 +526,12 @@ const resList = { ...@@ -526,6 +526,12 @@ const resList = {
ext: '.png', ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/catMessageBg.e74d2bf93254933a994d05aa9ce29f9e3914c149.png', url: '//yun.duiba.com.cn/spark/assets/catMessageBg.e74d2bf93254933a994d05aa9ce29f9e3914c149.png',
uuid: 'fc1fd3ee-e606-46de-9bb6-ea5fb41567df' uuid: 'fc1fd3ee-e606-46de-9bb6-ea5fb41567df'
},
'3fe9ac60-f1aa-4da3-93da-c67e5a9dc3a6': {
name: 'catNameBtnGray',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/catNameBtnGray.954587775085edff2210de9ab0d7ca1ef9e34e4e.png',
uuid: '3fe9ac60-f1aa-4da3-93da-c67e5a9dc3a6'
} }
}; };
export default resList; export default resList;
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment