This commit is contained in:
caoqianming 2020-04-29 18:14:36 +08:00
parent 9462471611
commit 3cab778234
3 changed files with 4 additions and 14 deletions

View File

@ -68,16 +68,7 @@ Page({
getDetail: function (id) {
var that = this
api.request(`/cms/article/${id}/`,'GET').then(res => {
if(res.data.elink){
let elink_f = getApp().globalData.host + '/redirect?url='+res.data.elink
console.log(elink_f)
that.setData({
elink_f:elink_f
})
}else{
that.setData(res.data)
}
that.setData(res.data)
})
},

View File

@ -1,11 +1,10 @@
<web-view wx:if="{{elink_f}}" src="{{elink_f}}"></web-view>
<view class="page" wx:else>
<view class="page">
<view class="page__hd" style="padding:20px">
<view class="page__title" >{{title}}</view>
<view class="page__desc">
<span style="font-weight:bold;color:darkblue;font-size:16px">{{ifrom}} </span>
<text class="weui-badge" style="background:orange" wx:if="{{is_top}}">置顶</text>
<text class="weui-badge" style="background:green">原创</text>
<text class="weui-badge" style="background:green" wx:if="{{!elink}}">原创</text>
</view>
</view>
<view class="page__bd">

View File

@ -202,7 +202,7 @@ class ConsumerViewSet(ModelViewSet):
companyname = sheet['C'+str(m)].value
if companyname:
companyname = companyname.replace(' ', '')
companyobj = Company.objects.get_or_create(id=companydict[companyname])[0]
companyobj = Company.objects.get_or_create(name=companyname)[0]
workscope = sheet['d'+str(m)].value
if Consumer.objects.filter(username = username).exists():
obj = Consumer.objects.filter(username = username).first()