mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:13:26 +08:00
【优化】调整地图选点插件,让其支持支付宝小程序。
This commit is contained in:
@@ -16,16 +16,17 @@
|
||||
</view>
|
||||
|
||||
<view class="coreshop-padding-10">
|
||||
<u--form :model="form" :rules="rules" ref="uForm" errorType="message" labelPosition="left" labelWidth="80">
|
||||
<u-form-item label="收货人" prop="name" borderBottom clearValidate>
|
||||
<u--form :model="form" :rules="rules" ref="uForm" errorType="message" labelPosition="left">
|
||||
<u-form-item label="收货人" labelWidth="80" prop="name" borderBottom clearValidate>
|
||||
<u--input v-model="form.name" placeholder="请填写收货人姓名" />
|
||||
</u-form-item>
|
||||
<u-form-item label="手机号" prop="mobile" borderBottom clearValidate>
|
||||
<u-form-item label="手机号" labelWidth="80" prop="mobile" borderBottom clearValidate>
|
||||
<u--input v-model="form.mobile" placeholder="请填写收货人手机号" />
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="省市县" borderBottom>
|
||||
<coreshop-select v-model="show" mode="mutil-column-auto" :list="pickerList" :default-value="pickerIndex" @confirm="onConfirm"></coreshop-select>
|
||||
<u-form-item label="省市县" labelWidth="80" borderBottom>
|
||||
<coreshop-select v-model="show" mode="mutil-column-auto" :list="pickerList"
|
||||
:default-value="pickerIndex" @confirm="onConfirm"></coreshop-select>
|
||||
<!-- 注意:由于兼容性差异,如果需要使用前后插槽,nvue下需使用u--input,非nvue下需使用u-input -->
|
||||
<!-- #ifndef APP-NVUE -->
|
||||
<u-input :value="pickerValue" type="select" disabled placeholder="请选择省市区区域">
|
||||
@@ -45,7 +46,7 @@
|
||||
<!-- #endif -->
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="街道社区" borderBottom @click="toMap">
|
||||
<u-form-item label="街道社区" labelWidth="80" borderBottom @click="toMap">
|
||||
<!-- 注意:由于兼容性差异,如果需要使用前后插槽,nvue下需使用u--input,非nvue下需使用u-input -->
|
||||
<!-- #ifndef APP-NVUE -->
|
||||
<u-input :value="form.street" type="text" disabled placeholder="请定位">
|
||||
@@ -71,33 +72,36 @@
|
||||
<u--input v-model="form.latitude" disabled placeholder="请选择街道获取纬度" />
|
||||
</u-form-item>-->
|
||||
|
||||
<u-form-item label="详细地址" prop="address" borderBottom clearValidate>
|
||||
<u-form-item label="详细地址" labelWidth="80" prop="address" borderBottom clearValidate>
|
||||
<u--textarea v-model="form.address" placeholder="请输入内容"></u--textarea>
|
||||
<!--<u--input v-model="form.address" placeholder="请填写收货详细地址" type="textarea" />-->
|
||||
</u-form-item>
|
||||
<u-form-item label="设为默认">
|
||||
<u-form-item label="设为默认" labelWidth="80">
|
||||
<u-switch slot="right" v-model="checked"></u-switch>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
</view>
|
||||
|
||||
<view class="coreshop-bottomBox">
|
||||
<button class="coreshop-btn coreshop-btn-square coreshop-btn-w" @click="delShip" v-if="id && id != 0" :disabled='submitStatus' :loading='submitStatus'>删除</button>
|
||||
<button class="coreshop-btn coreshop-btn-square coreshop-btn-w" @click="delShip" v-if="id && id != 0"
|
||||
:disabled='submitStatus' :loading='submitStatus'>删除</button>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button class="coreshop-btn coreshop-btn-square coreshop-btn-w" @click="wechatAddress" v-if="!id">从微信获取</button>
|
||||
<button class="coreshop-btn coreshop-btn-square coreshop-btn-w" @click="wechatAddress"
|
||||
v-if="!id">从微信获取</button>
|
||||
<!-- #endif -->
|
||||
<button class="coreshop-btn coreshop-btn-square coreshop-btn-b" @click="saveShip" :disabled='submitStatus' :loading='submitStatus'>保存</button>
|
||||
<button class="coreshop-btn coreshop-btn-square coreshop-btn-b" @click="saveShip" :disabled='submitStatus'
|
||||
:loading='submitStatus'>保存</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// #ifdef MP-WEIXIN
|
||||
const chooseLocation = requirePlugin('chooseLocation');
|
||||
// #endif
|
||||
// #ifdef APP-PLUS || APP-PLUS-NVUE
|
||||
// #endif
|
||||
export default {
|
||||
// #ifdef MP-WEIXIN
|
||||
const chooseLocation = requirePlugin('chooseLocation');
|
||||
// #endif
|
||||
// #ifdef APP-PLUS || APP-PLUS-NVUE
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
getType: 1, //1手动输入,0从微信获取
|
||||
@@ -449,6 +453,7 @@
|
||||
this.pickerIndex = [this.provinceKey, this.cityKey, this.areaKey];
|
||||
},
|
||||
toMap() {
|
||||
const _this = this;
|
||||
// #ifdef MP-WEIXIN
|
||||
const txMapkey = this.$store.state.config.qqMapKey; //使用在腾讯位置服务申请的key
|
||||
const referer = this.$store.state.config.shopName; //调用插件的app的名称
|
||||
@@ -464,6 +469,22 @@
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-ALIPAY
|
||||
my.chooseLocation({
|
||||
latitude: this.form.latitude == "" ? this.latitude : this.form.latitude,
|
||||
longitude: this.form.longitude == "" ? this.longitude : this.form.longitude,
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
_this.form.latitude = res.latitude;
|
||||
_this.form.longitude = res.longitude;
|
||||
_this.form.street = res.address;
|
||||
},
|
||||
fail: function (err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS || APP-PLUS-NVUE
|
||||
uni.chooseLocation({
|
||||
success: (res) => {
|
||||
@@ -516,8 +537,10 @@
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
page { background: #fff; }
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user