index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <template>
  2. <view class="top-cont">
  3. <view class="content">
  4. <view class="user-info">
  5. <view class="left">
  6. <view class="name-phone">
  7. <view class="name">{{user.nickName}}</view>
  8. <view class="phone" v-if="user!=null">{{$parsePhone(user.phonenumber)}}</view>
  9. </view>
  10. </view>
  11. <view class="msg-box" >
  12. {{user.deptName}}
  13. </view>
  14. </view>
  15. <!-- 常用工具 -->
  16. <view class="used-tools">
  17. <view class="title">常用工具</view>
  18. <view class="tools-list">
  19. <view class="item" @click="toCreateOrder()">
  20. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/image/userimg/my_cforder.png" mode=""></image>
  21. <text class="text">商品制单</text>
  22. </view>
  23. <!-- <view class="item" @click="toCreateCoupon()">
  24. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/icon_coupon.png" mode=""></image>
  25. <text class="text">制单优惠券</text>
  26. </view> -->
  27. <!-- <view class="item" @click="toPay()">
  28. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/money.png" mode=""></image>
  29. <text class="text">微信收款</text>
  30. </view> -->
  31. <!-- <view class="item" @click="alipay()">
  32. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/money.png" mode=""></image>
  33. <text class="text">支付宝收款</text>
  34. </view> -->
  35. <view class="item" @click="toOrder()">
  36. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/image/userimg/my_cforder.png" mode=""></image>
  37. <text class="text">我的订单</text>
  38. </view>
  39. <view class="item" @click="navTo('/pages_company/order/changePriceOrderList')">
  40. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/image/userimg/my_cforder.png" mode=""></image>
  41. <text class="text">实收改价申请</text>
  42. </view>
  43. <!-- <view class="item" @click="toPackage()">
  44. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/package.png" mode=""></image>
  45. <text class="text">商品套餐</text>
  46. </view>
  47. <view class="item" @click="toCoupon()">
  48. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/icon_coupon.png" mode=""></image>
  49. <text class="text">套餐优惠券</text>
  50. </view> -->
  51. </view>
  52. </view>
  53. <!-- 退出登录按钮 -->
  54. <view class="log-out" @click="logout">退出登录</view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import {getUserInfo,getQrImg} from './api/companyUser.js'
  60. export default {
  61. data() {
  62. return {
  63. user:null,
  64. };
  65. },
  66. onLoad() {
  67. console.log("onload")
  68. },
  69. onShow() {
  70. console.log("onshow")
  71. this.getUserInfo()
  72. },
  73. methods: {
  74. alipay(){
  75. // var url="http://alipay.yjf.runtzh.com/#/?companyId="+this.user.companyId+"&companyUserId="+this.user.userId
  76. // uni.setClipboardData({
  77. // data:url,
  78. // success:()=>{
  79. // uni.showToast({
  80. // title:'收款地址已复制到剪切板',
  81. // icon:'none'
  82. // })
  83. // }
  84. // });
  85. uni.navigateTo({
  86. url:'/pages_company/alipayImg'
  87. })
  88. },
  89. toCreateOrder(){
  90. uni.navigateTo({
  91. url:'/pages_company/order/productList'
  92. })
  93. },
  94. toPay(){
  95. uni.navigateTo({
  96. url:'/pages_user/user/pay?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  97. })
  98. },
  99. toOrder(){
  100. uni.navigateTo({
  101. url:'/pages_company/storeOrder?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  102. })
  103. },
  104. navTo(url){
  105. uni.navigateTo({
  106. url:url
  107. })
  108. },
  109. toPackage(){
  110. uni.navigateTo({
  111. url:'/pages_company/storeProductPackage?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  112. })
  113. },
  114. toCoupon(){
  115. uni.navigateTo({
  116. url:'/pages_company/coupon'
  117. })
  118. },
  119. toCreateCoupon(){
  120. uni.navigateTo({
  121. url:'/pages_company/order/coupon'
  122. })
  123. },
  124. toCreateOrderCoupon(){
  125. uni.navigateTo({
  126. url:'/pages_company/order/coupon'
  127. })
  128. },
  129. getUserInfo(){
  130. var data={token:uni.getStorageSync('CompanyUserToken')}
  131. getUserInfo(data).then(
  132. res => {
  133. if(res.code==200){
  134. this.user=res.data;
  135. }
  136. else if(res.code==403){
  137. uni.setStorageSync('companyUserId',null);
  138. uni.setStorageSync('CompanyUserToken',null);
  139. uni.navigateBack({
  140. delta:-1
  141. })
  142. }else{
  143. uni.showToast({
  144. icon:'none',
  145. title: res.msg,
  146. });
  147. }
  148. },
  149. rej => {}
  150. );
  151. },
  152. logout(){
  153. uni.showModal({
  154. title:"提示",
  155. content:"确认退出登录吗?",
  156. showCancel:true,
  157. cancelText:'取消',
  158. confirmText:'确定',
  159. success:res=>{
  160. if(res.confirm){
  161. uni.setStorageSync('companyUserId',null);
  162. uni.setStorageSync('CompanyUserToken',null);
  163. uni.navigateBack({
  164. delta:-1
  165. })
  166. }else{
  167. }
  168. }
  169. })
  170. },
  171. // 跳转页面
  172. navgetTo(url) {
  173. this.$isLogin().then(res => {
  174. if(res){
  175. uni.navigateTo({
  176. url: url
  177. })
  178. }
  179. })
  180. },
  181. }
  182. }
  183. </script>
  184. <style lang="scss">
  185. .content{
  186. margin: 20upx 0upx;
  187. padding: 0 20upx;
  188. .user-info{
  189. padding: 30upx;
  190. display: flex;
  191. align-items: center;
  192. justify-content: space-between;
  193. .left{
  194. position: relative;
  195. display: flex;
  196. .head-img{
  197. width: 120upx;
  198. height: 120upx;
  199. border-radius: 50%;
  200. overflow: hidden;
  201. margin-right: 30upx;
  202. border: 4upx solid #FFFFFF;
  203. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  204. image{
  205. width: 100%;
  206. height: 100%;
  207. }
  208. }
  209. .name-phone{
  210. padding-top: 15upx;
  211. .name{
  212. font-size: 36upx;
  213. font-family: PingFang SC;
  214. font-weight: bold;
  215. color: #111111;
  216. line-height: 1;
  217. }
  218. .phone{
  219. font-size: 28upx;
  220. font-family: PingFang SC;
  221. font-weight: 500;
  222. color: #666666;
  223. line-height: 1;
  224. margin-top: 30upx;
  225. }
  226. }
  227. }
  228. .msg-box{
  229. padding: 5rpx 15upx;
  230. min-height: 30upx;
  231. line-height: 30upx;
  232. font-size: 22upx;
  233. font-family: PingFang SC;
  234. font-weight: 500;
  235. color: #FFFFFF;
  236. border-radius: 8rpx;
  237. background-color: #2583EB;
  238. }
  239. }
  240. .used-tools{
  241. box-sizing: border-box;
  242. background: #FFFFFF;
  243. border-radius: 16upx;
  244. padding: 40upx 30upx;
  245. .title{
  246. font-size: 32upx;
  247. font-family: PingFang SC;
  248. font-weight: bold;
  249. color: #222222;
  250. line-height: 1;
  251. }
  252. .tools-list{
  253. margin-top: 50upx;
  254. display: flex;
  255. flex-wrap: wrap;
  256. width: 100%;
  257. .item{
  258. box-sizing: border-box;
  259. width: 25%;
  260. display: flex;
  261. flex-direction: column;
  262. align-items: center;
  263. justify-content: center;
  264. margin-bottom: 50upx;
  265. position: relative;
  266. image{
  267. width: 44upx;
  268. height: 44upx;
  269. }
  270. .text{
  271. font-size: 24upx;
  272. font-family: PingFang SC;
  273. font-weight: 500;
  274. color: #111111;
  275. line-height: 1;
  276. margin-top: 20upx;
  277. }
  278. .contact-btn{
  279. display: inline-block;
  280. position: absolute;
  281. top: 0;
  282. left: 0;
  283. width: 100%;
  284. height: 100%;
  285. opacity: 0;
  286. }
  287. }
  288. }
  289. }
  290. .log-out{
  291. height: 80upx;
  292. line-height: 80upx;
  293. text-align: center;
  294. font-size: 26upx;
  295. font-family: PingFang SC;
  296. font-weight: 500;
  297. color: #666666;
  298. background: #FFFFFF;
  299. border-radius: 16upx;
  300. margin-top: 20upx;
  301. }
  302. }
  303. </style>