Commit 4444d73f authored by Edwise's avatar Edwise 🍷

1234

parent 07783be2
......@@ -51,6 +51,15 @@
position: absolute;
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 {
width: 500rpx;
height: 147rpx;
......
......@@ -4,10 +4,11 @@
<image class="catnamedialogbg" src={{resList['50779aee-069e-4dd9-b2ff-88beda9f43d1'].url}} />
<label class="catnamedialoglabel">铲屎官~帮我取个名字吧!喵~</label>
</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">
<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>
</view>
</view>
......@@ -15,13 +15,16 @@ const {
Component({
props: {
//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: ""
},
data: {
resList: resList,
catName: "",
catImg: ""
catNameText: "",
catImg: "",
btnV: false,
isControlled: false
},
methods: {
/**获取字符串字符长度 */
......@@ -54,22 +57,37 @@ Component({
console.log("随即名字")
let name = "Edwise"
this.setData({
catName: name
catNameText: name
})
this.props.catName = name;
},
this.setCatName(name);
},
/**获取名字 */
getCatName(e) {
// console.log(e.detail.value)
this.props.catName = e.detail.value;
// console.log(this.props.catName)
this.setData({
catNameText: e.detail.value
})
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() {
let name = this.props.catName;
let len = this.getlen(name);
console.log("名称字符长度",len)
console.log("名称字符长度", len)
if (len <= 0) {
my.showToast({
content: "名字不能为空哦",
......
......@@ -526,6 +526,12 @@ const resList = {
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/catMessageBg.e74d2bf93254933a994d05aa9ce29f9e3914c149.png',
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;
This diff is collapsed.
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