[新增]企业主页,企业活动

This commit is contained in:
zdx
2020-12-28 10:38:29 +08:00
parent d3fa1d743c
commit 3a559141d1
106 changed files with 4587 additions and 164 deletions

View File

@@ -0,0 +1,81 @@
Page({
data: {
crowdfund_item_id: '',
addressList: [],
info: '',
remark: '',
crowdfund_id: ''
},
onLoad(e) {
wx.$api.companyModule.crowdfundsCreat(e.crowdfund_item_id).then(res => {
console.log(res);
if (res.address.length > 0) {
this.setData({
address_id: res.address[0].address_id,
addressList: res.address,
})
}
this.setData({
crowdfund_item_id: e.crowdfund_item_id,
info: res.info,
crowdfund_id: e.crowdfund_id
})
console.log(this.data.info);
}).catch(res => {
wx.navigateBack({})
})
},
input(e) {
this.setData({
remark: e.detail.value
})
},
nowActed(e) {
wx.showLoading({
title: '创建中...',
mask: 'true'
})
wx.$api.companyModule.crowdfundsCreatOrder(this.data.crowdfund_item_id, this.data.address_id, this.data.remark).then(res => {
var data = {};
if (res.trade_no) {
wx.login({
success: res1 => {
data = {
trade_no: res.trade_no,
code: res1.code
}
wx.$api.companyModule.wechat(data).then(res => {
var ress = JSON.parse(res);
wx.hideLoading({});
wx.requestPayment({
timeStamp: ress.timeStamp,
nonceStr: ress.nonceStr,
package: ress.package,
signType: 'MD5',
paySign: ress.paySign,
success: res => {
wx.showToast({
title: '创建订单成功',
})
wx.navigateTo({
url: '/pages/home/projectSuccess/projectSuccess?crowdfund_id=' + this.data.crowdfund_id,
})
},
fail(res) {
wx.showToast({
title: '支付失败',
})
}
})
}).catch(res => {
console.log(res)
})
}
})
}
}).catch(res => {
wx.navigateBack({})
})
}
})

View File

@@ -0,0 +1,5 @@
{
"navigationBarTitleText": "确认订单",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#378fff"
}

View File

@@ -0,0 +1,46 @@
<!-- 地址信息 -->
<view class="besure_address">
<view style="flex:1;">
<view class="userinfo">张冬雪 14745798066 <span class="type"> 学校 </span> <span class="moren"> 默认 </span></view>
<view class="des">黑龙江省哈尔滨市南岗区汉水路451号省科学院研究所7楼</view>
</view>
<image class="icon_right" src="/static/images/icon_right.png" mode="widthFix" style="width:12rpx;"></image>
</view>
<!-- 商品信息 -->
<view class="besure_goods">
<image class="besure_goods_img" src="{{info.pictures[0]}}" />
<view class="besure_goods_right">
<view class="title">项目名称:{{info.title}}。</view>
<view class="price"> <span>¥{{info.price}}</span>x1</view>
</view>
</view>
<!-- 物流备注 -->
<view class="besure_bottom mt20">
<view class="left">配送方式</view>
<span>{{info.shipping}}</span>
</view>
<view class="besure_bottom">
<view class="left">订单备注</view>
<input type="text" bindinput="input" placeholder="输入备注" />
</view>
<!-- 商家价格 -->
<view class="besure_bottom mt20">
<view class="left">商品总价</view>
<span>¥{{info.price}}</span>
</view>
<view class="besure_bottom">
<view class="left">应付总价</view>
<span style='font-weight:bold;'>¥{{info.price}}</span>
</view>
<view class="besure_notice">温馨提示下单后未发货可自主申请退款项目成功后7日内由企业安排发货。</view>
<!-- 底部按钮 -->
<view class="besure_now_act {{acted?'acted':''}}" catchtap="nowActed" data-acted='{{acted}}'>
<view class="left"><span>合计:</span>¥{{info.price}}</view>
<span>{{acted?'已提交订单':'提交订单'}}</span>
</view>

View File

@@ -0,0 +1,182 @@
/* 立即报名 */
.besure_now_act {
margin-top: 20rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
font-size: 42rpx;
font-weight: 600;
color: #333;
background-color: #fff;
padding: 20rpx 30rpx;
position: fixed;
bottom: 0;
width: 100%;
height: 120rpx;
}
.besure_bottom .left{
width: 160rpx;
}
.besure_now_act .left span {
font-size: 28rpx;
color: #333;
font-weight: normal;
}
.besure_now_act>span {
margin-left: 60rpx;
flex: 1;
display: inline-block;
background-color: #378fff;
color: #fff;
font-size: 30rpx;
border-radius: 50rpx;
padding: 20rpx .0;
text-align: center;
font-weight: 600;
}
.acted span {
background-color: #999;
}
.besure_bottom {
width: 100%;
padding: 30rpx;
background-color: #fff;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
font-size: 28rpx;
color: #333;
border-top: solid 1rpx #f7f7f7;
}
.besure_bottom input , .besure_bottom>span {
flex: 1;
/* margin-left: 30rpx; */
padding-top: 4rpx;
}
.besure_notice {
padding: 30rpx 20rpx;
font-size: 28rpx;
color: #999;
}
.mt20 {
margin-top: 20rpx;
}
/* 商品图片及信息 */
.besure_goods {
margin-top: 30rpx;
padding: 30rpx 20rpx;
background-color: #fff;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
box-sizing: border-box;
}
.besure_goods_img {
width: 160rpx;
height: 160rpx;
border-radius: 10rpx;
}
.besure_goods_right {
flex: 1;
margin-left: 30rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
align-self: flex-start;
min-height: 160rpx;
}
.besure_goods_right .title {
font-size: 28rpx;
color: #333;
}
.besure_goods_right .price {
display: flex;
flex-direction: row;
justify-content: space-between;
align-self: flex-start;
box-sizing: border-box;
width: 100%;
font-size: 26rpx;
color: #999;
margin-top: 30rpx;
}
.besure_goods_right .price span {
color: #333;
font-size: 32rpx;
font-weight: 600;
}
/* 地址信息展示 */
.besure_address {
width: 100%;
padding: 50rpx 30rpx;
box-sizing: border-box;
background-color: #fff;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
}
.besure_address .userinfo {
font-size: 34rpx;
color: #333333;
font-weight: 600;
padding-bottom: 10rpx;
display: flex;
flex-direction: row;
justify-content: start;
align-items: center;
box-sizing: border-box;
}
.besure_address .icon_right {
margin-left: 20rpx;
}
.besure_address .userinfo .type {
display: inline-block;
background-color: #378fff;
color: #fff;
border-radius: 20rpx;
font-size: 20rpx;
padding: 6rpx 20rpx;
margin-left: 10rpx;
}
.besure_address .userinfo .moren {
display: inline-block;
background-color: #ffcc00;
color: #fff;
border-radius: 20rpx;
font-size: 20rpx;
padding: 6rpx 20rpx;
margin-left: 10rpx;
}
.besure_address .des {
font-size: 24rpx;
padding-top: 10rpx;
}